(function(e){var t={};function n(i){if(t[i]){return t[i].exports}var r=t[i]={i:i,l:false,exports:{}};e[i].call(r.exports,r,r.exports,n);r.l=true;return r.exports}n.m=e;n.c=t;n.d=function(e,t,i){if(!n.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:i})}};n.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};n.d(t,"a",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p="";return n(n.s=8)})([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.waitOnEventOrTimeout=t.WaitOnType=t.localized=t.animationStarted=t.normalizeWheelEventDelta=t.binarySearchFirstItem=t.watchScroll=t.scrollIntoView=t.getOutputScale=t.approximateFraction=t.roundToDivide=t.getVisibleElements=t.parseQueryString=t.noContextMenuHandler=t.getPDFFileNameFromURL=t.ProgressBar=t.EventBus=t.NullL10n=t.mozL10n=t.RendererType=t.cloneObj=t.VERTICAL_PADDING=t.SCROLLBAR_PADDING=t.MAX_AUTO_SCALE=t.UNKNOWN_SCALE=t.MAX_SCALE=t.MIN_SCALE=t.DEFAULT_SCALE=t.DEFAULT_SCALE_VALUE=t.CSS_UNITS=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var a=n(1);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o=96/72;var u="auto";var l=1;var c=.25;var d=10;var h=0;var f=1.25;var v=40;var g=5;var p={CANVAS:"canvas",SVG:"svg"};function m(e,t){if(!t){return e}return e.replace(/\{\{\s*(\w+)\s*\}\}/g,function(e,n){return n in t?t[n]:"{{"+n+"}}"})}var w={get:function e(t,n,i){return Promise.resolve(m(i,n))},translate:function e(t){return Promise.resolve()}};a.PDFJS.disableFullscreen=a.PDFJS.disableFullscreen===undefined?false:a.PDFJS.disableFullscreen;a.PDFJS.useOnlyCssZoom=a.PDFJS.useOnlyCssZoom===undefined?false:a.PDFJS.useOnlyCssZoom;a.PDFJS.maxCanvasPixels=a.PDFJS.maxCanvasPixels===undefined?16777216:a.PDFJS.maxCanvasPixels;a.PDFJS.disableHistory=a.PDFJS.disableHistory===undefined?false:a.PDFJS.disableHistory;a.PDFJS.disableTextLayer=a.PDFJS.disableTextLayer===undefined?false:a.PDFJS.disableTextLayer;a.PDFJS.ignoreCurrentPositionOnZoom=a.PDFJS.ignoreCurrentPositionOnZoom===undefined?false:a.PDFJS.ignoreCurrentPositionOnZoom;{a.PDFJS.locale=a.PDFJS.locale===undefined&&typeof navigator!=="undefined"?navigator.language:a.PDFJS.locale}function b(e){var t=window.devicePixelRatio||1;var n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;var i=t/n;return{sx:i,sy:i,scaled:i!==1}}function y(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var i=e.offsetParent;if(!i){return}var r=e.offsetTop+e.clientTop;var a=e.offsetLeft+e.clientLeft;while(i.clientHeight===i.scrollHeight||n&&getComputedStyle(i).overflow==="hidden"){if(i.dataset._scaleY){r/=i.dataset._scaleY;a/=i.dataset._scaleX}r+=i.offsetTop;a+=i.offsetLeft;i=i.offsetParent;if(!i){return}}if(t){if(t.top!==undefined){r+=t.top}if(t.left!==undefined){a+=t.left;i.scrollLeft=a}}i.scrollTop=r}function P(e,t){var n=function n(a){if(r){return}r=window.requestAnimationFrame(function n(){r=null;var a=e.scrollTop;var s=i.lastY;if(a!==s){i.down=a>s}i.lastY=a;t(i)})};var i={down:true,lastY:e.scrollTop,_eventHandler:n};var r=null;e.addEventListener("scroll",n,true);return i}function S(e){var t=e.split("&");var n=Object.create(null);for(var i=0,r=t.length;i<r;++i){var a=t[i].split("=");var s=a[0].toLowerCase();var o=a.length>1?a[1]:null;n[decodeURIComponent(s)]=decodeURIComponent(o)}return n}function _(e,t){var n=0;var i=e.length-1;if(e.length===0||!t(e[i])){return e.length}if(t(e[n])){return n}while(n<i){var r=n+i>>1;var a=e[r];if(t(a)){i=r}else{n=r+1}}return n}function C(e){if(Math.floor(e)===e){return[e,1]}var t=1/e;var n=8;if(t>n){return[1,n]}else if(Math.floor(t)===t){return[1,t]}var i=e>1?t:e;var r=0,a=1,s=1,o=1;while(true){var u=r+s,l=a+o;if(l>n){break}if(i<=u/l){s=u;o=l}else{r=u;a=l}}var c=void 0;if(i-r/a<s/o-i){c=i===e?[r,a]:[a,r]}else{c=i===e?[s,o]:[o,s]}return c}function k(e,t){var n=e%t;return n===0?e:Math.round(e-n+t)}function L(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var i=e.scrollTop,r=i+e.clientHeight;var a=e.scrollLeft,s=a+e.clientWidth;function o(e){var t=e.div;var n=t.offsetTop+t.clientTop+t.clientHeight;return n>i}var u=[],l=void 0,c=void 0;var d=void 0,h=void 0,f=void 0,v=void 0;var g=void 0,p=void 0;var m=t.length===0?0:_(t,o);for(var w=m,b=t.length;w<b;w++){l=t[w];c=l.div;d=c.offsetTop+c.clientTop;h=c.clientHeight;if(d>r){break}g=c.offsetLeft+c.clientLeft;p=c.clientWidth;if(g+p<a||g>s){continue}f=Math.max(0,i-d)+Math.max(0,d+h-r);v=(h-f)*100/h|0;u.push({id:l.id,x:g,y:d,view:l,percent:v})}var y=u[0];var P=u[u.length-1];if(n){u.sort(function(e,t){var n=e.percent-t.percent;if(Math.abs(n)>.001){return-n}return e.id-t.id})}return{first:y,last:P,views:u}}function E(e){e.preventDefault()}function T(e){var t=0,n=e.length;while(t<n&&e[t].trim()===""){t++}return e.substr(t,5).toLowerCase()==="data:"}function I(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"document.pdf";if(T(e)){console.warn("getPDFFileNameFromURL: "+'ignoring "data:" URL for performance reasons.');return t}var n=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;var i=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i;var r=n.exec(e);var a=i.exec(r[1])||i.exec(r[2])||i.exec(r[3]);if(a){a=a[0];if(a.indexOf("%")!==-1){try{a=i.exec(decodeURIComponent(a))[0]}catch(e){}}}return a||t}function B(e){var t=Math.sqrt(e.deltaX*e.deltaX+e.deltaY*e.deltaY);var n=Math.atan2(e.deltaY,e.deltaX);if(-.25*Math.PI<n&&n<.75*Math.PI){t=-t}var i=0;var r=1;var a=30;var s=30;if(e.deltaMode===i){t/=a*s}else if(e.deltaMode===r){t/=s}return t}function x(e){var t=Object.create(null);for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n)){t[n]=e[n]}}return t}var D={EVENT:"event",TIMEOUT:"timeout"};function F(e){var t=e.target,n=e.name,i=e.delay,s=i===undefined?0:i;if((typeof t==="undefined"?"undefined":r(t))!=="object"||!(n&&typeof n==="string")||!(Number.isInteger(s)&&s>=0)){return Promise.reject(new Error("waitOnEventOrTimeout - invalid paramaters."))}var o=(0,a.createPromiseCapability)();function u(e){if(t instanceof O){t.off(n,l)}else{t.removeEventListener(n,l)}if(d){clearTimeout(d)}o.resolve(e)}var l=u.bind(null,D.EVENT);if(t instanceof O){t.on(n,l)}else{t.addEventListener(n,l)}var c=u.bind(null,D.TIMEOUT);var d=setTimeout(c,s);return o.promise}var N=new Promise(function(e){window.requestAnimationFrame(e)});var V=void 0;var M=Promise.resolve();var O=function(){function e(){s(this,e);this._listeners=Object.create(null)}i(e,[{key:"on",value:function e(t,n){var i=this._listeners[t];if(!i){i=[];this._listeners[t]=i}i.push(n)}},{key:"off",value:function e(t,n){var i=this._listeners[t];var r=void 0;if(!i||(r=i.indexOf(n))<0){return}i.splice(r,1)}},{key:"dispatch",value:function e(t){var n=this._listeners[t];if(!n||n.length===0){return}var i=Array.prototype.slice.call(arguments,1);n.slice(0).forEach(function(e){e.apply(null,i)})}}]);return e}();function A(e,t,n){return Math.min(Math.max(e,t),n)}var R=function(){function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},i=n.height,r=n.width,a=n.units;s(this,e);this.visible=true;this.div=document.querySelector(t+" .progress");this.bar=this.div.parentNode;this.height=i||100;this.width=r||100;this.units=a||"%";this.div.style.height=this.height+this.units;this.percent=0}i(e,[{key:"_updateBar",value:function e(){if(this._indeterminate){this.div.classList.add("indeterminate");this.div.style.width=this.width+this.units;return}this.div.classList.remove("indeterminate");var t=this.width*this._percent/100;this.div.style.width=t+this.units}},{key:"setWidth",value:function e(t){if(!t){return}var n=t.parentNode;var i=n.offsetWidth-t.offsetWidth;if(i>0){this.bar.setAttribute("style","width: calc(100% - "+i+"px);")}}},{key:"hide",value:function e(){if(!this.visible){return}this.visible=false;this.bar.classList.add("hidden");document.body.classList.remove("loadingInProgress")}},{key:"show",value:function e(){if(this.visible){return}this.visible=true;document.body.classList.add("loadingInProgress");this.bar.classList.remove("hidden")}},{key:"percent",get:function e(){return this._percent},set:function e(t){this._indeterminate=isNaN(t);this._percent=A(t,0,100);this._updateBar()}}]);return e}();t.CSS_UNITS=o;t.DEFAULT_SCALE_VALUE=u;t.DEFAULT_SCALE=l;t.MIN_SCALE=c;t.MAX_SCALE=d;t.UNKNOWN_SCALE=h;t.MAX_AUTO_SCALE=f;t.SCROLLBAR_PADDING=v;t.VERTICAL_PADDING=g;t.cloneObj=x;t.RendererType=p;t.mozL10n=V;t.NullL10n=w;t.EventBus=O;t.ProgressBar=R;t.getPDFFileNameFromURL=I;t.noContextMenuHandler=E;t.parseQueryString=S;t.getVisibleElements=L;t.roundToDivide=k;t.approximateFraction=C;t.getOutputScale=b;t.scrollIntoView=y;t.watchScroll=P;t.binarySearchFirstItem=_;t.normalizeWheelEventDelta=B;t.animationStarted=N;t.localized=M;t.WaitOnType=D;t.waitOnEventOrTimeout=F},function(e,t,n){"use strict";var i;if(typeof window!=="undefined"&&window["pdfjs-dist/build/pdf"]){i=window["pdfjs-dist/build/pdf"]}else{i=require("../build/pdf.js")}e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGlobalEventBus=t.attachDOMEventsToEventBus=undefined;var i=n(0);function r(e){e.on("documentload",function(){var e=document.createEvent("CustomEvent");e.initCustomEvent("documentload",true,true,{});window.dispatchEvent(e)});e.on("pagerendered",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagerendered",true,true,{pageNumber:e.pageNumber,cssTransform:e.cssTransform});e.source.div.dispatchEvent(t)});e.on("textlayerrendered",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("textlayerrendered",true,true,{pageNumber:e.pageNumber});e.source.textLayerDiv.dispatchEvent(t)});e.on("pagechange",function(e){var t=document.createEvent("UIEvents");t.initUIEvent("pagechange",true,true,window,0);t.pageNumber=e.pageNumber;e.source.container.dispatchEvent(t)});e.on("pagesinit",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagesinit",true,true,null);e.source.container.dispatchEvent(t)});e.on("pagesloaded",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagesloaded",true,true,{pagesCount:e.pagesCount});e.source.container.dispatchEvent(t)});e.on("scalechange",function(e){var t=document.createEvent("UIEvents");t.initUIEvent("scalechange",true,true,window,0);t.scale=e.scale;t.presetValue=e.presetValue;e.source.container.dispatchEvent(t)});e.on("updateviewarea",function(e){var t=document.createEvent("UIEvents");t.initUIEvent("updateviewarea",true,true,window,0);t.location=e.location;e.source.container.dispatchEvent(t)});e.on("find",function(e){if(e.source===window){return}var t=document.createEvent("CustomEvent");t.initCustomEvent("find"+e.type,true,true,{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:e.caseSensitive,highlightAll:e.highlightAll,findPrevious:e.findPrevious});window.dispatchEvent(t)});e.on("attachmentsloaded",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("attachmentsloaded",true,true,{attachmentsCount:e.attachmentsCount});e.source.container.dispatchEvent(t)});e.on("sidebarviewchanged",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("sidebarviewchanged",true,true,{view:e.view});e.source.outerContainer.dispatchEvent(t)});e.on("pagemode",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagemode",true,true,{mode:e.mode});e.source.pdfViewer.container.dispatchEvent(t)});e.on("namedaction",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("namedaction",true,true,{action:e.action});e.source.pdfViewer.container.dispatchEvent(t)});e.on("presentationmodechanged",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("presentationmodechanged",true,true,{active:e.active,switchInProgress:e.switchInProgress});window.dispatchEvent(t)});e.on("outlineloaded",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("outlineloaded",true,true,{outlineCount:e.outlineCount});e.source.container.dispatchEvent(t)})}var a=null;function s(){if(a){return a}a=new i.EventBus;r(a);return a}t.attachDOMEventsToEventBus=r;t.getGlobalEventBus=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var a=3e4;var s={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};var o=function(){function e(){r(this,e);this.pdfViewer=null;this.pdfThumbnailViewer=null;this.onIdle=null;this.highestPriorityPage=null;this.idleTimeout=null;this.printing=false;this.isThumbnailViewEnabled=false}i(e,[{key:"setViewer",value:function e(t){this.pdfViewer=t}},{key:"setThumbnailViewer",value:function e(t){this.pdfThumbnailViewer=t}},{key:"isHighestPriority",value:function e(t){return this.highestPriorityPage===t.renderingId}},{key:"renderHighestPriority",value:function e(t){if(this.idleTimeout){clearTimeout(this.idleTimeout);this.idleTimeout=null}if(this.pdfViewer.forceRendering(t)){return}if(this.pdfThumbnailViewer&&this.isThumbnailViewEnabled){if(this.pdfThumbnailViewer.forceRendering()){return}}if(this.printing){return}if(this.onIdle){this.idleTimeout=setTimeout(this.onIdle.bind(this),a)}}},{key:"getHighestPriority",value:function e(t,n,i){var r=t.views;var a=r.length;if(a===0){return false}for(var s=0;s<a;++s){var o=r[s].view;if(!this.isViewFinished(o)){return o}}if(i){var u=t.last.id;if(n[u]&&!this.isViewFinished(n[u])){return n[u]}}else{var l=t.first.id-2;if(n[l]&&!this.isViewFinished(n[l])){return n[l]}}return null}},{key:"isViewFinished",value:function e(t){return t.renderingState===s.FINISHED}},{key:"renderView",value:function e(t){var n=this;switch(t.renderingState){case s.FINISHED:return false;case s.PAUSED:this.highestPriorityPage=t.renderingId;t.resume();break;case s.RUNNING:this.highestPriorityPage=t.renderingId;break;case s.INITIAL:this.highestPriorityPage=t.renderingId;var i=function e(){n.renderHighestPriority()};t.draw().then(i,i);break}return true}}]);return e}();t.RenderingStates=s;t.PDFRenderingQueue=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFPrintServiceFactory=t.DefaultExternalServices=t.PDFViewerApplication=undefined;var i=function(){function e(e,t){var n=[];var i=true;var r=false;var a=undefined;try{for(var s=e[Symbol.iterator](),o;!(i=(o=s.next()).done);i=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){r=true;a=e}finally{try{if(!i&&s["return"])s["return"]()}finally{if(r)throw a}}return n}return function(t,n){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,n)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var r=n(0);var a=n(1);var s=n(6);var o=n(3);var u=n(10);var l=n(11);var c=n(2);var d=n(15);var h=n(16);var f=n(17);var v=n(18);var g=n(19);var p=n(7);var m=n(20);var w=n(5);var b=n(21);var y=n(22);var P=n(23);var S=n(25);var _=n(26);var C=n(27);var k=1.1;var L=5e3;function E(e){e.imageResourcesPath="./images/";e.workerSrc=window.pdfJsPathToWorker;e.cMapUrl="../web/cmaps/";e.cMapPacked=true}var T={updateFindControlState:function e(t){},initPassiveLoading:function e(t){},fallback:function e(t,n){},reportTelemetry:function e(t){},createDownloadManager:function e(){throw new Error("Not implemented: createDownloadManager")},createPreferences:function e(){throw new Error("Not implemented: createPreferences")},createL10n:function e(){throw new Error("Not implemented: createL10n")},supportsIntegratedFind:false,supportsDocumentFonts:true,supportsDocumentColors:true,supportedMouseWheelZoomModifierKeys:{ctrlKey:true,metaKey:true}};var I={initialBookmark:document.location.hash.substring(1),initialized:false,fellback:false,appConfig:null,pdfDocument:null,pdfLoadingTask:null,printService:null,pdfViewer:null,pdfThumbnailViewer:null,pdfRenderingQueue:null,pdfPresentationMode:null,pdfDocumentProperties:null,pdfLinkService:null,pdfHistory:null,pdfSidebar:null,pdfOutlineViewer:null,pdfAttachmentViewer:null,pdfCursorTools:null,store:null,downloadManager:null,overlayManager:null,preferences:null,toolbar:null,secondaryToolbar:null,eventBus:null,l10n:null,isInitialViewSet:false,downloadComplete:false,viewerPrefs:{sidebarViewOnLoad:u.SidebarView.NONE,pdfBugEnabled:false,showPreviousViewOnLoad:true,defaultZoomValue:"",disablePageMode:false,disablePageLabels:false,renderer:"canvas",enhanceTextSelection:false,renderInteractiveForms:false,enablePrintAutoRotate:true},isViewerEmbedded:window.parent!==window,url:"",baseUrl:"",externalServices:T,_boundEvents:{},initialize:function e(t){var n=this;this.preferences=this.externalServices.createPreferences();E(a.PDFJS);this.appConfig=t;return this._readPreferences().then(function(){return n._initializeL10n()}).then(function(){return n._initializeViewerComponents()}).then(function(){n.bindEvents();n.bindWindowEvents();var e=t.appContainer||document.documentElement;n.l10n.translate(e).then(function(){n.eventBus.dispatch("localized")});if(n.isViewerEmbedded&&!a.PDFJS.isExternalLinkTargetSet()){a.PDFJS.externalLinkTarget=a.PDFJS.LinkTarget.TOP}n.initialized=true})},_readPreferences:function e(){var t=this.preferences,n=this.viewerPrefs;return Promise.all([t.get("enableWebGL").then(function e(t){a.PDFJS.disableWebGL=!t}),t.get("sidebarViewOnLoad").then(function e(t){n["sidebarViewOnLoad"]=t}),t.get("pdfBugEnabled").then(function e(t){n["pdfBugEnabled"]=t}),t.get("showPreviousViewOnLoad").then(function e(t){n["showPreviousViewOnLoad"]=t}),t.get("defaultZoomValue").then(function e(t){n["defaultZoomValue"]=t}),t.get("enhanceTextSelection").then(function e(t){n["enhanceTextSelection"]=t}),t.get("disableTextLayer").then(function e(t){if(a.PDFJS.disableTextLayer===true){return}a.PDFJS.disableTextLayer=t}),t.get("disableRange").then(function e(t){if(a.PDFJS.disableRange===true){return}a.PDFJS.disableRange=t}),t.get("disableStream").then(function e(t){if(a.PDFJS.disableStream===true){return}a.PDFJS.disableStream=t}),t.get("disableAutoFetch").then(function e(t){a.PDFJS.disableAutoFetch=t}),t.get("disableFontFace").then(function e(t){if(a.PDFJS.disableFontFace===true){return}a.PDFJS.disableFontFace=t}),t.get("useOnlyCssZoom").then(function e(t){a.PDFJS.useOnlyCssZoom=t}),t.get("externalLinkTarget").then(function e(t){if(a.PDFJS.isExternalLinkTargetSet()){return}a.PDFJS.externalLinkTarget=t}),t.get("renderer").then(function e(t){n["renderer"]=t}),t.get("renderInteractiveForms").then(function e(t){n["renderInteractiveForms"]=t}),t.get("disablePageMode").then(function e(t){n["disablePageMode"]=t}),t.get("disablePageLabels").then(function e(t){n["disablePageLabels"]=t}),t.get("enablePrintAutoRotate").then(function e(t){n["enablePrintAutoRotate"]=t})]).catch(function(e){})},_initializeL10n:function e(){if(this.viewerPrefs["pdfBugEnabled"]){var t=document.location.hash.substring(1);var n=(0,r.parseQueryString)(t);if("locale"in n){a.PDFJS.locale=n["locale"]}}this.l10n=this.externalServices.createL10n();return this.l10n.getDirection().then(function(e){document.getElementsByTagName("html")[0].dir=e})},_initializeViewerComponents:function e(){var t=this;var n=this.appConfig;return new Promise(function(e,i){t.overlayManager=new d.OverlayManager;var r=n.eventBus||(0,c.getGlobalEventBus)();t.eventBus=r;var a=new o.PDFRenderingQueue;a.onIdle=t.cleanup.bind(t);t.pdfRenderingQueue=a;var C=new w.PDFLinkService({eventBus:r});t.pdfLinkService=C;var k=t.externalServices.createDownloadManager();t.downloadManager=k;var L=n.mainContainer;var E=n.viewerContainer;t.pdfViewer=new l.PDFViewer({container:L,viewer:E,eventBus:r,renderingQueue:a,linkService:C,downloadManager:k,renderer:t.viewerPrefs["renderer"],l10n:t.l10n,enhanceTextSelection:t.viewerPrefs["enhanceTextSelection"],renderInteractiveForms:t.viewerPrefs["renderInteractiveForms"],enablePrintAutoRotate:t.viewerPrefs["enablePrintAutoRotate"]});a.setViewer(t.pdfViewer);C.setViewer(t.pdfViewer);var T=n.sidebar.thumbnailView;t.pdfThumbnailViewer=new P.PDFThumbnailViewer({container:T,renderingQueue:a,linkService:C,l10n:t.l10n});a.setThumbnailViewer(t.pdfThumbnailViewer);t.pdfHistory=new m.PDFHistory({linkService:C,eventBus:r});C.setHistory(t.pdfHistory);t.findController=new p.PDFFindController({pdfViewer:t.pdfViewer});t.findController.onUpdateResultsCount=function(e){if(t.supportsIntegratedFind){return}t.findBar.updateResultsCount(e)};t.findController.onUpdateState=function(e,n,i){if(t.supportsIntegratedFind){t.externalServices.updateFindControlState({result:e,findPrevious:n})}else{t.findBar.updateUIState(e,n,i)}};t.pdfViewer.setFindController(t.findController);var I=Object.create(n.findBar);I.findController=t.findController;I.eventBus=r;t.findBar=new g.PDFFindBar(I,t.l10n);t.pdfDocumentProperties=new v.PDFDocumentProperties(n.documentProperties,t.overlayManager,t.l10n);t.pdfCursorTools=new s.PDFCursorTools({container:L,eventBus:r,preferences:t.preferences});t.toolbar=new _.Toolbar(n.toolbar,L,r,t.l10n);t.secondaryToolbar=new S.SecondaryToolbar(n.secondaryToolbar,L,r);if(t.supportsFullscreen){t.pdfPresentationMode=new y.PDFPresentationMode({container:L,viewer:E,pdfViewer:t.pdfViewer,eventBus:r,contextMenuItems:n.fullscreen})}t.passwordPrompt=new h.PasswordPrompt(n.passwordOverlay,t.overlayManager,t.l10n);t.pdfOutlineViewer=new b.PDFOutlineViewer({container:n.sidebar.outlineView,eventBus:r,linkService:C});t.pdfAttachmentViewer=new f.PDFAttachmentViewer({container:n.sidebar.attachmentsView,eventBus:r,downloadManager:k});var B=Object.create(n.sidebar);B.pdfViewer=t.pdfViewer;B.pdfThumbnailViewer=t.pdfThumbnailViewer;B.pdfOutlineViewer=t.pdfOutlineViewer;B.eventBus=r;t.pdfSidebar=new u.PDFSidebar(B,t.l10n);t.pdfSidebar.onToggled=t.forceRendering.bind(t);e(undefined)})},run:function e(t){this.initialize(t).then(F)},zoomIn:function e(t){var n=this.pdfViewer.currentScale;do{n=(n*k).toFixed(2);n=Math.ceil(n*10)/10;n=Math.min(r.MAX_SCALE,n)}while(--t>0&&n<r.MAX_SCALE);this.pdfViewer.currentScaleValue=n},zoomOut:function e(t){var n=this.pdfViewer.currentScale;do{n=(n/k).toFixed(2);n=Math.floor(n*10)/10;n=Math.max(r.MIN_SCALE,n)}while(--t>0&&n>r.MIN_SCALE);this.pdfViewer.currentScaleValue=n},get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0},get pageRotation(){return this.pdfViewer.pagesRotation},set page(e){this.pdfViewer.currentPageNumber=e},get page(){return this.pdfViewer.currentPageNumber},get printing(){return!!this.printService},get supportsPrinting(){return pe.instance.supportsPrinting},get supportsFullscreen(){var e=void 0;var t=document.documentElement;e=!!(t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen||t.msRequestFullscreen);if(document.fullscreenEnabled===false||document.mozFullScreenEnabled===false||document.webkitFullscreenEnabled===false||document.msFullscreenEnabled===false){e=false}if(e&&a.PDFJS.disableFullscreen===true){e=false}return(0,a.shadow)(this,"supportsFullscreen",e)},get supportsIntegratedFind(){return this.externalServices.supportsIntegratedFind},get supportsDocumentFonts(){return this.externalServices.supportsDocumentFonts},get supportsDocumentColors(){return this.externalServices.supportsDocumentColors},get loadingBar(){var e=new r.ProgressBar("#loadingBar"+window.pdfJsViewerId);return(0,a.shadow)(this,"loadingBar",e)},get supportedMouseWheelZoomModifierKeys(){return this.externalServices.supportedMouseWheelZoomModifierKeys},initPassiveLoading:function e(){throw new Error("Not implemented: initPassiveLoading")},setTitleUsingUrl:function e(t){this.url=t;this.baseUrl=t.split("#")[0];var n=(0,r.getPDFFileNameFromURL)(t,"");if(!n){try{n=decodeURIComponent((0,a.getFilenameFromUrl)(t))||t}catch(e){n=t}}this.setTitle(n)},setTitle:function e(t){return},close:function e(){var t=this.appConfig.errorWrapper.container;t.setAttribute("hidden","true");if(!this.pdfLoadingTask){return Promise.resolve()}var n=this.pdfLoadingTask.destroy();this.pdfLoadingTask=null;if(this.pdfDocument){this.pdfDocument=null;this.pdfThumbnailViewer.setDocument(null);this.pdfViewer.setDocument(null);this.pdfLinkService.setDocument(null,null);this.pdfDocumentProperties.setDocument(null,null)}this.store=null;this.isInitialViewSet=false;this.downloadComplete=false;this.pdfSidebar.reset();this.pdfOutlineViewer.reset();this.pdfAttachmentViewer.reset();this.findController.reset();this.findBar.reset();this.toolbar.reset();this.secondaryToolbar.reset();if(typeof PDFBug!=="undefined"){PDFBug.cleanup()}return n},open:function e(t,n){var i=this;if(arguments.length>2||typeof n==="number"){return Promise.reject(new Error("Call of open() with obsolete signature."))}if(this.pdfLoadingTask){return this.close().then(function(){i.preferences.reload();return i.open(t,n)})}var r=Object.create(null);if(typeof t==="string"){this.setTitleUsingUrl(t);r.url=t}else if(t&&"byteLength"in t){r.data=t}else if(t.url&&t.originalUrl){this.setTitleUsingUrl(t.originalUrl);r.url=t.url}if(n){for(var s in n){if(!a.PDFJS.pdfjsNext&&s==="scale"){console.error('Call of open() with obsolete "scale" argument, '+'please use the "defaultZoomValue" preference instead.');continue}else if(s==="length"){this.pdfDocumentProperties.setFileSize(n[s])}r[s]=n[s]}}var o=(0,a.getDocument)(r);this.pdfLoadingTask=o;o.onPassword=function(e,t){i.passwordPrompt.setUpdateCallback(e,t);i.passwordPrompt.open()};o.onProgress=function(e){var t=e.loaded,n=e.total;i.progress(t/n)};o.onUnsupportedFeature=this.fallback.bind(this);return o.promise.then(function(e){i.load(e)},function(e){var t=e&&e.message;var n=void 0;if(e instanceof a.InvalidPDFException){n=i.l10n.get("invalid_file_error",null,"Invalid or corrupted PDF file.")}else if(e instanceof a.MissingPDFException){n=i.l10n.get("missing_file_error",null,"Missing PDF file.")}else if(e instanceof a.UnexpectedResponseException){n=i.l10n.get("unexpected_response_error",null,"Unexpected server response.")}else{n=i.l10n.get("loading_error",null,"An error occurred while loading the PDF.")}return n.then(function(e){i.error(e,{message:t});throw new Error(e)})})},download:function e(){var t=this;function n(){o.downloadUrl(i,s)}var i=this.baseUrl;var s=(0,r.getPDFFileNameFromURL)(this.url);var o=this.downloadManager;o.onerror=function(e){t.error("PDF failed to download: "+e)};if(!this.pdfDocument||!this.downloadComplete){n();return}this.pdfDocument.getData().then(function(e){var t=(0,a.createBlob)(e,"application/pdf");o.download(t,i,s)}).catch(n)},fallback:function e(t){},error:function e(t,n){var i=[this.l10n.get("error_version_info",{version:a.version||"?",build:a.build||"?"},"PDF.js v{{version}} (build: {{build}})")];if(n){i.push(this.l10n.get("error_message",{message:n.message},"Message: {{message}}"));if(n.stack){i.push(this.l10n.get("error_stack",{stack:n.stack},"Stack: {{stack}}"))}else{if(n.filename){i.push(this.l10n.get("error_file",{file:n.filename},"File: {{file}}"))}if(n.lineNumber){i.push(this.l10n.get("error_line",{line:n.lineNumber},"Line: {{line}}"))}}}var s=this.appConfig.errorWrapper;var o=s.container;o.removeAttribute("hidden");var u=s.errorMessage;u.textContent=t;var l=s.closeButton;l.onclick=function(){o.setAttribute("hidden","true")};var c=s.errorMoreInfo;var d=s.moreInfoButton;var h=s.lessInfoButton;d.onclick=function(){c.removeAttribute("hidden");d.setAttribute("hidden","true");h.removeAttribute("hidden");c.style.height=c.scrollHeight+"px"};h.onclick=function(){c.setAttribute("hidden","true");d.removeAttribute("hidden");h.setAttribute("hidden","true")};d.oncontextmenu=r.noContextMenuHandler;h.oncontextmenu=r.noContextMenuHandler;l.oncontextmenu=r.noContextMenuHandler;d.removeAttribute("hidden");h.setAttribute("hidden","true");Promise.all(i).then(function(e){c.value=e.join("\n")})},progress:function e(t){var n=this;if(this.downloadComplete){return}var i=Math.round(t*100);if(i>this.loadingBar.percent||isNaN(i)){this.loadingBar.percent=i;if(a.PDFJS.disableAutoFetch&&i){if(this.disableAutoFetchLoadingBarTimeout){clearTimeout(this.disableAutoFetchLoadingBarTimeout);this.disableAutoFetchLoadingBarTimeout=null}this.loadingBar.show();this.disableAutoFetchLoadingBarTimeout=setTimeout(function(){n.loadingBar.hide();n.disableAutoFetchLoadingBarTimeout=null},L)}}},load:function e(t){var n=this;this.pdfDocument=t;t.getDownloadInfo().then(function(){n.downloadComplete=true;n.loadingBar.hide();h.then(function(){n.eventBus.dispatch("documentload",{source:n})})});var s=t.getPageMode().catch(function(){});this.toolbar.setPagesCount(t.numPages,false);this.secondaryToolbar.setPagesCount(t.numPages);var o=this.documentFingerprint=t.fingerprint;var l=this.store=new C.ViewHistory(o);var c=void 0;c=null;this.pdfLinkService.setDocument(t,c);this.pdfDocumentProperties.setDocument(t,this.url);var d=this.pdfViewer;d.setDocument(t);var h=d.firstPagePromise;var f=d.pagesPromise;var v=d.onePageRendered;var g=this.pdfThumbnailViewer;g.setDocument(t);h.then(function(e){n.loadingBar.setWidth(n.appConfig.viewerContainer);if(!a.PDFJS.disableHistory&&!n.isViewerEmbedded){var t=!n.viewerPrefs["showPreviousViewOnLoad"];n.pdfHistory.initialize(o,t);if(n.pdfHistory.initialBookmark){n.initialBookmark=n.pdfHistory.initialBookmark}}var c={bookmark:null,hash:null};var h=l.getMultiple({exists:false,page:"1",zoom:r.DEFAULT_SCALE_VALUE,scrollLeft:"0",scrollTop:"0",sidebarView:u.SidebarView.NONE}).catch(function(){});Promise.all([h,s]).then(function(e){var t=i(e,2),r=t[0],a=r===undefined?{}:r,s=t[1];var o=n.viewerPrefs["defaultZoomValue"]?"zoom="+n.viewerPrefs["defaultZoomValue"]:null;var u=n.viewerPrefs["sidebarViewOnLoad"];if(a.exists&&n.viewerPrefs["showPreviousViewOnLoad"]){o="page="+a.page+"&zoom="+(n.viewerPrefs["defaultZoomValue"]||a.zoom)+","+a.scrollLeft+","+a.scrollTop;u=u||a.sidebarView|0}if(s&&!n.viewerPrefs["disablePageMode"]){u=u||ge(s)}return{hash:o,sidebarView:u}}).then(function(e){var t=e.hash,i=e.sidebarView;c.bookmark=n.initialBookmark;c.hash=t;n.setInitialView(t,{sidebarView:i});if(!n.isViewerEmbedded){d.focus()}return f}).then(function(){if(!c.bookmark&&!c.hash){return}if(d.hasEqualPageSizes){return}n.initialBookmark=c.bookmark;d.currentScaleValue=d.currentScaleValue;n.setInitialView(c.hash)}).then(function(){d.update()})});t.getPageLabels().then(function(e){if(!e||n.viewerPrefs["disablePageLabels"]){return}var i=0,r=e.length;if(r!==n.pagesCount){console.error("The number of Page Labels does not match "+"the number of pages in the document.");return}while(i<r&&e[i]===(i+1).toString()){i++}if(i===r){return}d.setPageLabels(e);g.setPageLabels(e);n.toolbar.setPagesCount(t.numPages,true);n.toolbar.setPageNumber(d.currentPageNumber,d.currentPageLabel)});f.then(function(){if(!n.supportsPrinting){return}t.getJavaScript().then(function(e){if(e.length){console.warn("Warning: JavaScript is not supported");n.fallback(a.UNSUPPORTED_FEATURES.javaScript)}var t=/\bprint\s*\(/;for(var i=0,r=e.length;i<r;i++){var s=e[i];if(s&&t.test(s)){setTimeout(function(){window.print()});return}}})});Promise.all([v,r.animationStarted]).then(function(){t.getOutline().then(function(e){n.pdfOutlineViewer.render({outline:e})});t.getAttachments().then(function(e){n.pdfAttachmentViewer.render({attachments:e})})});t.getMetadata().then(function(e){var t=e.info,i=e.metadata;n.documentInfo=t;n.metadata=i;var r=void 0;if(i&&i.has("dc:title")){var s=i.get("dc:title");if(s!=="Untitled"){r=s}}if(!r&&t&&t["Title"]){r=t["Title"]}if(r){n.setTitle(r+" - "+document.title)}if(t.IsAcroFormPresent){console.warn("Warning: AcroForm/XFA is not supported");n.fallback(a.UNSUPPORTED_FEATURES.forms)}})},setInitialView:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},i=n.sidebarView;this.isInitialViewSet=true;this.pdfSidebar.setInitialView(i);if(this.initialBookmark){this.pdfLinkService.setHash(this.initialBookmark);this.initialBookmark=null}else if(t){this.pdfLinkService.setHash(t)}this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber,this.pdfViewer.currentPageLabel);this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber);if(!this.pdfViewer.currentScaleValue){this.pdfViewer.currentScaleValue=r.DEFAULT_SCALE_VALUE}},cleanup:function e(){if(!this.pdfDocument){return}this.pdfViewer.cleanup();this.pdfThumbnailViewer.cleanup();if(this.pdfViewer.renderer!==r.RendererType.SVG){this.pdfDocument.cleanup()}},forceRendering:function e(){this.pdfRenderingQueue.printing=this.printing;this.pdfRenderingQueue.isThumbnailViewEnabled=this.pdfSidebar.isThumbnailViewVisible;this.pdfRenderingQueue.renderHighestPriority()},beforePrint:function e(){var t=this;if(this.printService){return}if(!this.supportsPrinting){this.l10n.get("printing_not_supported",null,"Warning: Printing is not fully supported by "+"this browser.").then(function(e){t.error(e)});return}if(!this.pdfViewer.pageViewsReady){this.l10n.get("printing_not_ready",null,"Warning: The PDF is not fully loaded for printing.").then(function(e){window.alert(e)});return}var n=this.pdfViewer.getPagesOverview();var i=this.appConfig.printContainer;var r=pe.instance.createPrintService(this.pdfDocument,n,i,this.l10n);this.printService=r;this.forceRendering();r.layout()},afterPrint:function e(){if(this.printService){this.printService.destroy();this.printService=null}this.forceRendering()},rotatePages:function e(t){if(!this.pdfDocument){return}var n=this.pdfViewer,i=this.pdfThumbnailViewer;var r=n.currentPageNumber;var a=(n.pagesRotation+360+t)%360;n.pagesRotation=a;i.pagesRotation=a;this.forceRendering();n.currentPageNumber=r},requestPresentationMode:function e(){if(!this.pdfPresentationMode){return}this.pdfPresentationMode.request()},bindEvents:function e(){var t=this.eventBus,n=this._boundEvents;this.unbindEvents();n.beforePrint=this.beforePrint.bind(this);n.afterPrint=this.afterPrint.bind(this);t.on("resize",H);t.on("hashchange",j);t.on("beforeprint",n.beforePrint);t.on("afterprint",n.afterPrint);t.on("pagerendered",V);t.on("textlayerrendered",M);t.on("updateviewarea",z);t.on("pagechanging",le);t.on("scalechanging",ue);t.on("sidebarviewchanged",U);t.on("pagemode",O);t.on("namedaction",A);t.on("presentationmodechanged",R);t.on("presentationmode",W);t.on("openfile",q);t.on("print",G);t.on("download",Q);t.on("firstpage",Z);t.on("lastpage",K);t.on("nextpage",X);t.on("previouspage",Y);t.on("zoomin",$);t.on("zoomout",ee);t.on("pagenumberchanged",te);t.on("scalechanged",ne);t.on("rotatecw",ie);t.on("rotateccw",re);t.on("find",se);t.on("findfromurlhash",oe);t.on("fileinputchange",J);if(!this.documentPropertiesBinded||this.documentPropertiesBinded!==true){t.on("documentproperties",ae);this.documentPropertiesBinded=true}},bindWindowEvents:function e(){var t=this.eventBus,n=this._boundEvents;n.windowResize=function(){t.dispatch("resize")};n.windowHashChange=function(){t.dispatch("hashchange",{hash:document.location.hash.substring(1)})};n.windowBeforePrint=function(){t.dispatch("beforeprint")};n.windowAfterPrint=function(){t.dispatch("afterprint")};window.addEventListener("wheel",he);window.addEventListener("click",fe);window.addEventListener("keydown",ve);window.addEventListener("resize",n.windowResize);window.addEventListener("hashchange",n.windowHashChange);window.addEventListener("beforeprint",n.windowBeforePrint);window.addEventListener("afterprint",n.windowAfterPrint);n.windowChange=function(e){var n=e.target.files;if(!n||n.length===0){return}t.dispatch("fileinputchange",{fileInput:e.target})};window.addEventListener("change",n.windowChange)},unbindEvents:function e(){var t=this.eventBus,n=this._boundEvents;t.off("resize",H);t.off("hashchange",j);t.off("beforeprint",n.beforePrint);t.off("afterprint",n.afterPrint);t.off("pagerendered",V);t.off("textlayerrendered",M);t.off("updateviewarea",z);t.off("pagechanging",le);t.off("scalechanging",ue);t.off("sidebarviewchanged",U);t.off("pagemode",O);t.off("namedaction",A);t.off("presentationmodechanged",R);t.off("presentationmode",W);t.off("openfile",q);t.off("print",G);t.off("download",Q);t.off("firstpage",Z);t.off("lastpage",K);t.off("nextpage",X);t.off("previouspage",Y);t.off("zoomin",$);t.off("zoomout",ee);t.off("pagenumberchanged",te);t.off("scalechanged",ne);t.off("rotatecw",ie);t.off("rotateccw",re);t.off("documentproperties",ae);t.off("find",se);t.off("findfromurlhash",oe);t.off("fileinputchange",J);n.beforePrint=null;n.afterPrint=null},unbindWindowEvents:function e(){var t=this._boundEvents;window.removeEventListener("wheel",he);window.removeEventListener("click",fe);window.removeEventListener("keydown",ve);window.removeEventListener("resize",t.windowResize);window.removeEventListener("hashchange",t.windowHashChange);window.removeEventListener("beforeprint",t.windowBeforePrint);window.removeEventListener("afterprint",t.windowAfterPrint);window.removeEventListener("change",t.windowChange);t.windowChange=null;t.windowResize=null;t.windowHashChange=null;t.windowBeforePrint=null;t.windowAfterPrint=null}};var B=void 0;{var x=["null"];B=function e(t){if(t===undefined){return}try{var n=new URL(window.location.href).origin||"null";if(x.indexOf(n)>=0){return}var i=new URL(t,window.location.href).origin;if(i!==n){throw new Error("file origin does not match viewer's")}}catch(e){var r=e&&e.message;I.l10n.get("loading_error",null,"An error occurred while loading the PDF.").then(function(e){I.error(e,{message:r})});throw e}}}function D(e){return new Promise(function(t,n){var i=I.appConfig;var r=document.createElement("script");r.src=i.debuggerScriptPath;r.onload=function(){PDFBug.enable(e);PDFBug.init({PDFJS:a.PDFJS,OPS:a.OPS},i.mainContainer);t()};r.onerror=function(){n(new Error("Cannot load debugger at "+r.src))};(document.getElementsByTagName("head")[0]||document.body).appendChild(r)})}function F(){var e=I.appConfig;var t=void 0;var n=document.location.search.substring(1);var i=[];t="file"in i?i.file:e.defaultUrl;B(t);var s=[];e.toolbar.openFile.setAttribute("hidden","true");e.secondaryToolbar.openFileButton.setAttribute("hidden","true");if(I.viewerPrefs["pdfBugEnabled"]){var o=document.location.hash.substring(1);var u=(0,r.parseQueryString)(o);if("disableworker"in u){a.PDFJS.disableWorker=u["disableworker"]==="true"}if("disablerange"in u){a.PDFJS.disableRange=u["disablerange"]==="true"}if("disablestream"in u){a.PDFJS.disableStream=u["disablestream"]==="true"}if("disableautofetch"in u){a.PDFJS.disableAutoFetch=u["disableautofetch"]==="true"}if("disablefontface"in u){a.PDFJS.disableFontFace=u["disablefontface"]==="true"}if("disablehistory"in u){a.PDFJS.disableHistory=u["disablehistory"]==="true"}if("webgl"in u){a.PDFJS.disableWebGL=u["webgl"]!=="true"}if("useonlycsszoom"in u){a.PDFJS.useOnlyCssZoom=u["useonlycsszoom"]==="true"}if("verbosity"in u){a.PDFJS.verbosity=u["verbosity"]|0}if("ignorecurrentpositiononzoom"in u){a.PDFJS.ignoreCurrentPositionOnZoom=u["ignorecurrentpositiononzoom"]==="true"}if("textlayer"in u){switch(u["textlayer"]){case"off":a.PDFJS.disableTextLayer=true;break;case"visible":case"shadow":case"hover":var l=e.viewerContainer;l.classList.add("textLayer-"+u["textlayer"]);break}}if("pdfbug"in u){a.PDFJS.pdfBug=true;var c=u["pdfbug"];var d=c.split(",");s.push(D(d))}}if(!I.supportsPrinting){e.toolbar.print.classList.add("hidden");e.secondaryToolbar.printButton.classList.add("hidden")}if(!I.supportsFullscreen){e.toolbar.presentationModeButton.classList.add("hidden");e.secondaryToolbar.presentationModeButton.classList.add("hidden")}if(I.supportsIntegratedFind){e.toolbar.viewFind.classList.add("hidden")}e.sidebar.mainContainer.addEventListener("transitionend",function(e){if(e.target===this){I.eventBus.dispatch("resize")}},true);e.sidebar.toggleButton.addEventListener("click",function(){I.pdfSidebar.toggle()});Promise.all(s).then(function(){N(t)}).catch(function(e){I.l10n.get("loading_error",null,"An error occurred while opening.").then(function(t){I.error(t,e)})})}var N=void 0;{N=function e(t){if(t&&t.lastIndexOf("file:",0)===0){I.setTitleUsingUrl(t);var n=new XMLHttpRequest;n.onload=function(){I.open(new Uint8Array(n.response))};try{console.dir(n);n.open("GET",t);n.responseType="arraybuffer";n.send()}catch(e){I.l10n.get("loading_error",null,"An error occurred while loading the PDF.").then(function(t){I.error(t,e)})}return}if(t){I.open(t)}}}function V(e){var t=e.pageNumber;var n=t-1;var i=I.pdfViewer.getPageView(n);if(t===I.page){I.toolbar.updateLoadingIndicatorState(false)}if(!i){return}if(I.pdfSidebar.isThumbnailViewVisible){var r=I.pdfThumbnailViewer.getThumbnail(n);r.setImage(i)}if(a.PDFJS.pdfBug&&Stats.enabled&&i.stats){Stats.add(t,i.stats)}if(i.error){I.l10n.get("rendering_error",null,"An error occurred while rendering the page.").then(function(e){I.error(e,i.error)})}}function M(e){}function O(e){var t=e.mode,n=void 0;switch(t){case"thumbs":n=u.SidebarView.THUMBS;break;case"bookmarks":case"outline":n=u.SidebarView.OUTLINE;break;case"attachments":n=u.SidebarView.ATTACHMENTS;break;case"none":n=u.SidebarView.NONE;break;default:console.error('Invalid "pagemode" hash parameter: '+t);return}I.pdfSidebar.switchView(n,true)}function A(e){var t=e.action;switch(t){case"GoToPage":I.appConfig.toolbar.pageNumber.select();break;case"Find":if(!I.supportsIntegratedFind){I.findBar.toggle()}break}}function R(e){var t=e.active,n=e.switchInProgress;I.pdfViewer.presentationModeState=n?l.PresentationModeState.CHANGING:t?l.PresentationModeState.FULLSCREEN:l.PresentationModeState.NORMAL}function U(e){I.pdfRenderingQueue.isThumbnailViewEnabled=I.pdfSidebar.isThumbnailViewVisible;var t=I.store;if(t&&I.isInitialViewSet){t.set("sidebarView",e.view).catch(function(){})}}function z(e){var t=e.location,n=I.store;if(n&&I.isInitialViewSet){n.setMultiple({exists:true,page:t.pageNumber,zoom:t.scale,scrollLeft:t.left,scrollTop:t.top}).catch(function(){})}var i=I.pdfLinkService.getAnchorUrl(t.pdfOpenParams);I.appConfig.toolbar.viewBookmark.href=i;I.appConfig.secondaryToolbar.viewBookmarkButton.href=i;var r=I.pdfViewer.getPageView(I.page-1);var a=r.renderingState!==o.RenderingStates.FINISHED;I.toolbar.updateLoadingIndicatorState(a)}function H(){var e=I.pdfDocument,t=I.pdfViewer;if(!e){return}var n=t.currentScaleValue;if(n==="auto"||n==="page-fit"||n==="page-width"){t.currentScaleValue=n}t.update()}function j(e){var t=e.hash;if(!t){return}if(!I.isInitialViewSet){I.initialBookmark=t}else if(!I.pdfHistory.popStateInProgress){I.pdfLinkService.setHash(t)}}var J=void 0;{J=function e(t){var n=t.fileInput.files[0];if(!a.PDFJS.disableCreateObjectURL&&URL.createObjectURL){I.open(URL.createObjectURL(n))}else{var i=new FileReader;i.onload=function e(t){var n=t.target.result;I.open(new Uint8Array(n))};i.readAsArrayBuffer(n)}I.setTitleUsingUrl(n.name);var r=I.appConfig;r.toolbar.viewBookmark.setAttribute("hidden","true");r.secondaryToolbar.viewBookmarkButton.setAttribute("hidden","true");r.toolbar.download.setAttribute("hidden","true");r.secondaryToolbar.downloadButton.setAttribute("hidden","true")}}function W(){I.requestPresentationMode()}function q(){var e=I.appConfig.openFileInputName;document.getElementById(e).click()}function G(){if(window.pdfJsPrintDisabled!==true){window.print()}}function Q(){I.download()}function Z(){if(I.pdfDocument){I.page=1}}function K(){if(I.pdfDocument){I.page=I.pagesCount}}function X(){I.page++}function Y(){I.page--}function $(){I.zoomIn()}function ee(){I.zoomOut()}function te(e){var t=I.pdfViewer;t.currentPageLabel=e.value;if(e.value!==t.currentPageNumber.toString()&&e.value!==t.currentPageLabel){I.toolbar.setPageNumber(t.currentPageNumber,t.currentPageLabel)}}function ne(e){I.pdfViewer.currentScaleValue=e.value}function ie(){I.rotatePages(90)}function re(){I.rotatePages(-90)}function ae(){I.pdfDocumentProperties.open()}function se(e){I.findController.executeCommand("find"+e.type,{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:e.caseSensitive,highlightAll:e.highlightAll,findPrevious:e.findPrevious})}function oe(e){I.findController.executeCommand("find",{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:false,highlightAll:true,findPrevious:false})}function ue(e){I.toolbar.setPageScale(e.presetValue,e.scale);I.pdfViewer.update()}function le(e){var t=e.pageNumber;I.toolbar.setPageNumber(t,e.pageLabel||null);I.secondaryToolbar.setPageNumber(t);if(I.pdfSidebar.isThumbnailViewVisible){I.pdfThumbnailViewer.scrollThumbnailIntoView(t)}if(a.PDFJS.pdfBug&&Stats.enabled){var n=I.pdfViewer.getPageView(t-1);if(n.stats){Stats.add(t,n.stats)}}}var ce=false,de=void 0;function he(e){var t=I.pdfViewer;if(t.isInPresentationMode){return}if(e.ctrlKey||e.metaKey){var n=I.supportedMouseWheelZoomModifierKeys;if(e.ctrlKey&&!n.ctrlKey||e.metaKey&&!n.metaKey){return}e.preventDefault();if(ce){return}var i=t.currentScale;var a=(0,r.normalizeWheelEventDelta)(e);var s=3;var o=a*s;if(o<0){I.zoomOut(-o)}else{I.zoomIn(o)}var u=t.currentScale;if(i!==u){var l=u/i-1;var c=t.container.getBoundingClientRect();var d=e.clientX-c.left;var h=e.clientY-c.top;t.container.scrollLeft+=d*l;t.container.scrollTop+=h*l}}else{ce=true;clearTimeout(de);de=setTimeout(function(){ce=false},1e3)}}function fe(e){if(!I.secondaryToolbar.isOpen){return}var t=I.appConfig;if(I.pdfViewer.containsElement(e.target)||t.toolbar.container.contains(e.target)&&e.target!==t.secondaryToolbar.toggleButton){I.secondaryToolbar.close()}}function ve(e){if(I.overlayManager.active){return}var t=false,n=false;var i=(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0);var a=I.pdfViewer;var o=a&&a.isInPresentationMode;if(i===1||i===8||i===5||i===12){switch(e.keyCode){case 70:if(!I.supportsIntegratedFind){I.findBar.open();t=true}break;case 71:if(!I.supportsIntegratedFind){var u=I.findController.state;if(u){I.findController.executeCommand("findagain",{query:u.query,phraseSearch:u.phraseSearch,caseSensitive:u.caseSensitive,highlightAll:u.highlightAll,findPrevious:i===5||i===12})}t=true}break;case 61:case 107:case 187:case 171:if(!o){I.zoomIn()}t=true;break;case 173:case 109:case 189:if(!o){I.zoomOut()}t=true;break;case 48:case 96:if(!o){setTimeout(function(){a.currentScaleValue=r.DEFAULT_SCALE_VALUE});t=false}break;case 38:if(o||I.page>1){I.page=1;t=true;n=true}break;case 40:if(o||I.page<I.pagesCount){I.page=I.pagesCount;t=true;n=true}break}}if(i===1||i===8){switch(e.keyCode){case 83:I.download();t=true;break}}if(i===3||i===10){switch(e.keyCode){case 80:I.requestPresentationMode();t=true;break;case 71:I.appConfig.toolbar.pageNumber.select();t=true;break}}if(t){if(n&&!o){a.focus()}e.preventDefault();return}var l=document.activeElement||document.querySelector(":focus");var c=l&&l.tagName.toUpperCase();if(c==="INPUT"||c==="TEXTAREA"||c==="SELECT"){if(e.keyCode!==27){return}}if(i===0){switch(e.keyCode){case 38:case 33:case 8:if(!o&&a.currentScaleValue!=="page-fit"){break}case 37:if(a.isHorizontalScrollbarEnabled){break}case 75:case 80:if(I.page>1){I.page--}t=true;break;case 27:if(I.secondaryToolbar.isOpen){I.secondaryToolbar.close();t=true}if(!I.supportsIntegratedFind&&I.findBar.opened){I.findBar.close();t=true}break;case 40:case 34:case 32:if(!o&&a.currentScaleValue!=="page-fit"){break}case 39:if(a.isHorizontalScrollbarEnabled){break}case 74:case 78:if(I.page<I.pagesCount){I.page++}t=true;break;case 36:if(o||I.page>1){I.page=1;t=true;n=true}break;case 35:if(o||I.page<I.pagesCount){I.page=I.pagesCount;t=true;n=true}break;case 83:I.pdfCursorTools.switchTool(s.CursorTool.SELECT);break;case 72:I.pdfCursorTools.switchTool(s.CursorTool.HAND);break;case 82:I.rotatePages(90);break}}if(i===4){switch(e.keyCode){case 32:if(!o&&a.currentScaleValue!=="page-fit"){break}if(I.page>1){I.page--}t=true;break;case 82:I.rotatePages(-90);break}}if(!t&&!o){if(e.keyCode>=33&&e.keyCode<=40||e.keyCode===32&&c!=="BUTTON"){n=true}}if(n&&!a.containsElement(l)){a.focus()}if(t){e.preventDefault()}}function ge(e){switch(e){case"UseNone":return u.SidebarView.NONE;case"UseThumbs":return u.SidebarView.THUMBS;case"UseOutlines":return u.SidebarView.OUTLINE;case"UseAttachments":return u.SidebarView.ATTACHMENTS;case"UseOC":}return u.SidebarView.NONE}var pe={instance:{supportsPrinting:false,createPrintService:function e(){throw new Error("Not implemented: createPrintService")}}};t.PDFViewerApplication=I;t.DefaultExternalServices=T;t.PDFPrintServiceFactory=pe},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SimpleLinkService=t.PDFLinkService=undefined;var i=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var a=n(2);var s=n(0);function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=t.eventBus;o(this,e);this.eventBus=n||(0,a.getGlobalEventBus)();this.baseUrl=null;this.pdfDocument=null;this.pdfViewer=null;this.pdfHistory=null;this._pagesRefCache=null}r(e,[{key:"setDocument",value:function e(t,n){this.baseUrl=n;this.pdfDocument=t;this._pagesRefCache=Object.create(null)}},{key:"setViewer",value:function e(t){this.pdfViewer=t}},{key:"setHistory",value:function e(t){this.pdfHistory=t}},{key:"navigateTo",value:function e(t){var n=this;var i=function e(i){var r=i.namedDest,a=i.explicitDest;var s=a[0],o=void 0;if(s instanceof Object){o=n._cachedPageNumber(s);if(o===null){n.pdfDocument.getPageIndex(s).then(function(t){n.cachePageRef(t+1,s);e({namedDest:r,explicitDest:a})}).catch(function(){console.error('PDFLinkService.navigateTo: "'+s+'" is not '+('a valid page reference, for dest="'+t+'".'))});return}}else if((s|0)===s){o=s+1}else{console.error('PDFLinkService.navigateTo: "'+s+'" is not '+('a valid destination reference, for dest="'+t+'".'));return}if(!o||o<1||o>n.pagesCount){console.error('PDFLinkService.navigateTo: "'+o+'" is not '+('a valid page number, for dest="'+t+'".'));return}if(n.pdfHistory){n.pdfHistory.pushCurrentPosition();n.pdfHistory.push({namedDest:r,explicitDest:a,pageNumber:o})}n.pdfViewer.scrollPageIntoView({pageNumber:o,destArray:a})};new Promise(function(e,i){if(typeof t==="string"){n.pdfDocument.getDestination(t).then(function(n){e({namedDest:t,explicitDest:n})});return}e({namedDest:"",explicitDest:t})}).then(function(e){if(!(e.explicitDest instanceof Array)){return}i(e)})}},{key:"getDestinationHash",value:function e(t){if(typeof t==="string"){return this.getAnchorUrl("#"+escape(t))}if(t instanceof Array){var n=JSON.stringify(t);return this.getAnchorUrl("#"+escape(n))}return this.getAnchorUrl("")}},{key:"getAnchorUrl",value:function e(t){return(this.baseUrl||"")+t}},{key:"setHash",value:function e(t){var n=void 0,i=void 0;if(t.indexOf("=")>=0){var r=(0,s.parseQueryString)(t);if("search"in r){this.eventBus.dispatch("findfromurlhash",{source:this,query:r["search"].replace(/"/g,""),phraseSearch:r["phrase"]==="true"})}if("nameddest"in r){this.navigateTo(r.nameddest);return}if("page"in r){n=r.page|0||1}if("zoom"in r){var a=r.zoom.split(",");var o=a[0];var u=parseFloat(o);if(o.indexOf("Fit")===-1){i=[null,{name:"XYZ"},a.length>1?a[1]|0:null,a.length>2?a[2]|0:null,u?u/100:o]}else{if(o==="Fit"||o==="FitB"){i=[null,{name:o}]}else if(o==="FitH"||o==="FitBH"||o==="FitV"||o==="FitBV"){i=[null,{name:o},a.length>1?a[1]|0:null]}else if(o==="FitR"){if(a.length!==5){console.error('PDFLinkService.setHash: Not enough parameters for "FitR".')}else{i=[null,{name:o},a[1]|0,a[2]|0,a[3]|0,a[4]|0]}}else{console.error('PDFLinkService.setHash: "'+o+'" is not '+"a valid zoom value.")}}}if(i){this.pdfViewer.scrollPageIntoView({pageNumber:n||this.page,destArray:i,allowNegativeOffset:true})}else if(n){this.page=n}if("pagemode"in r){this.eventBus.dispatch("pagemode",{source:this,mode:r.pagemode})}}else{if(/^\d+$/.test(t)&&t<=this.pagesCount){console.warn("PDFLinkService_setHash: specifying a page number "+"directly after the hash symbol (#) is deprecated, "+('please use the "#page='+t+'" form instead.'));this.page=t|0}i=unescape(t);try{i=JSON.parse(i);if(!(i instanceof Array)){i=i.toString()}}catch(e){}if(typeof i==="string"||l(i)){this.navigateTo(i);return}console.error('PDFLinkService.setHash: "'+unescape(t)+'" is not '+"a valid destination.")}}},{key:"executeNamedAction",value:function e(t){switch(t){case"GoBack":if(this.pdfHistory){this.pdfHistory.back()}break;case"GoForward":if(this.pdfHistory){this.pdfHistory.forward()}break;case"NextPage":if(this.page<this.pagesCount){this.page++}break;case"PrevPage":if(this.page>1){this.page--}break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break;default:break}this.eventBus.dispatch("namedaction",{source:this,action:t})}},{key:"onFileAttachmentAnnotation",value:function e(t){var n=t.id,i=t.filename,r=t.content;this.eventBus.dispatch("fileattachmentannotation",{source:this,id:n,filename:i,content:r})}},{key:"cachePageRef",value:function e(t,n){var i=n.num+" "+n.gen+" R";this._pagesRefCache[i]=t}},{key:"_cachedPageNumber",value:function e(t){var n=t.num+" "+t.gen+" R";return this._pagesRefCache&&this._pagesRefCache[n]||null}},{key:"pagesCount",get:function e(){return this.pdfDocument?this.pdfDocument.numPages:0}},{key:"page",get:function e(){return this.pdfViewer.currentPageNumber},set:function e(t){this.pdfViewer.currentPageNumber=t}}]);return e}();function l(e){if(!(e instanceof Array)){return false}var t=e.length,n=true;if(t<2){return false}var r=e[0];if(!((typeof r==="undefined"?"undefined":i(r))==="object"&&typeof r.num==="number"&&(r.num|0)===r.num&&typeof r.gen==="number"&&(r.gen|0)===r.gen)&&!(typeof r==="number"&&(r|0)===r&&r>=0)){return false}var a=e[1];if(!((typeof a==="undefined"?"undefined":i(a))==="object"&&typeof a.name==="string")){return false}switch(a.name){case"XYZ":if(t!==5){return false}break;case"Fit":case"FitB":return t===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(t!==3){return false}break;case"FitR":if(t!==6){return false}n=false;break;default:return false}for(var s=2;s<t;s++){var o=e[s];if(!(typeof o==="number"||n&&o===null)){return false}}return true}var c=function(){function e(){o(this,e)}r(e,[{key:"navigateTo",value:function e(t){}},{key:"getDestinationHash",value:function e(t){return"#"}},{key:"getAnchorUrl",value:function e(t){return"#"}},{key:"setHash",value:function e(t){}},{key:"executeNamedAction",value:function e(t){}},{key:"onFileAttachmentAnnotation",value:function e(t){var n=t.id,i=t.filename,r=t.content}},{key:"cachePageRef",value:function e(t,n){}},{key:"page",get:function e(){return 0},set:function e(t){}}]);return e}();t.PDFLinkService=u;t.SimpleLinkService=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFCursorTools=t.CursorTool=undefined;var i=function(){function e(e,t){var n=[];var i=true;var r=false;var a=undefined;try{for(var s=e[Symbol.iterator](),o;!(i=(o=s.next()).done);i=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){r=true;a=e}finally{try{if(!i&&s["return"])s["return"]()}finally{if(r)throw a}}return n}return function(t,n){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,n)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var a=n(9);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o={SELECT:0,HAND:1,ZOOM:2};var u=function(){function e(t){var n=this;var r=t.container,u=t.eventBus,l=t.preferences;s(this,e);this.container=r;this.eventBus=u;this.active=o.SELECT;this.activeBeforePresentationMode=null;this.handTool=new a.GrabToPan({element:this.container});this._addEventListeners();Promise.all([l.get("cursorToolOnLoad"),l.get("enableHandToolOnLoad")]).then(function(e){var t=i(e,2),r=t[0],a=t[1];if(a===true){l.set("enableHandToolOnLoad",false);if(r===o.SELECT){r=o.HAND;l.set("cursorToolOnLoad",r).catch(function(){})}}n.switchTool(r)}).catch(function(){})}r(e,[{key:"switchTool",value:function e(t){var n=this;if(this.activeBeforePresentationMode!==null){return}if(t===this.active){return}var i=function e(){switch(n.active){case o.SELECT:break;case o.HAND:n.handTool.deactivate();break;case o.ZOOM:}};switch(t){case o.SELECT:i();break;case o.HAND:i();this.handTool.activate();break;case o.ZOOM:default:console.error('switchTool: "'+t+'" is an unsupported value.');return}this.active=t;this._dispatchEvent()}},{key:"_dispatchEvent",value:function e(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}},{key:"_addEventListeners",value:function e(){var t=this;this.eventBus.on("switchcursortool",function(e){t.switchTool(e.tool)});this.eventBus.on("presentationmodechanged",function(e){if(e.switchInProgress){return}var n=void 0;if(e.active){n=t.active;t.switchTool(o.SELECT);t.activeBeforePresentationMode=n}else{n=t.activeBeforePresentationMode;t.activeBeforePresentationMode=null;t.switchTool(n)}})}},{key:"activeTool",get:function e(){return this.active}}]);return e}();t.CursorTool=o;t.PDFCursorTools=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFFindController=t.FindState=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(1);var a=n(0);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};var u=-50;var l=-400;var c=250;var d={"\u2018":"'","\u2019":"'","\u201a":"'","\u201b":"'","\u201c":'"',"\u201d":'"',"\u201e":'"',"\u201f":'"',"\xbc":"1/4","\xbd":"1/2","\xbe":"3/4"};var h=function(){function e(t){var n=t.pdfViewer;s(this,e);this.pdfViewer=n;this.onUpdateResultsCount=null;this.onUpdateState=null;this.reset();var i=Object.keys(d).join("");this.normalizationRegex=new RegExp("["+i+"]","g")}i(e,[{key:"reset",value:function e(){var t=this;this.startedTextExtraction=false;this.extractTextPromises=[];this.pendingFindMatches=Object.create(null);this.active=false;this.pageContents=[];this.pageMatches=[];this.pageMatchesLength=null;this.matchCount=0;this.selected={pageIdx:-1,matchIdx:-1};this.offset={pageIdx:null,matchIdx:null};this.pagesToSearch=null;this.resumePageIdx=null;this.state=null;this.dirtyMatch=false;this.findTimeout=null;this._firstPagePromise=new Promise(function(e){t.resolveFirstPage=e})}},{key:"normalize",value:function e(t){return t.replace(this.normalizationRegex,function(e){return d[e]})}},{key:"_prepareMatches",value:function e(t,n,i){function r(e,t){var n=e[t];var i=e[t+1];if(t<e.length-1&&n.match===i.match){n.skipped=true;return true}for(var r=t-1;r>=0;r--){var a=e[r];if(a.skipped){continue}if(a.match+a.matchLength<n.match){break}if(a.match+a.matchLength>=n.match+n.matchLength){n.skipped=true;return true}}return false}t.sort(function(e,t){return e.match===t.match?e.matchLength-t.matchLength:e.match-t.match});for(var a=0,s=t.length;a<s;a++){if(r(t,a)){continue}n.push(t[a].match);i.push(t[a].matchLength)}}},{key:"calcFindPhraseMatch",value:function e(t,n,i){var r=[];var a=t.length;var s=-a;while(true){s=i.indexOf(t,s+a);if(s===-1){break}r.push(s)}this.pageMatches[n]=r}},{key:"calcFindWordMatch",value:function e(t,n,i){var r=[];var a=t.match(/\S+/g);for(var s=0,o=a.length;s<o;s++){var u=a[s];var l=u.length;var c=-l;while(true){c=i.indexOf(u,c+l);if(c===-1){break}r.push({match:c,matchLength:l,skipped:false})}}if(!this.pageMatchesLength){this.pageMatchesLength=[]}this.pageMatchesLength[n]=[];this.pageMatches[n]=[];this._prepareMatches(r,this.pageMatches[n],this.pageMatchesLength[n])}},{key:"calcFindMatch",value:function e(t){var n=this.normalize(this.pageContents[t]);var i=this.normalize(this.state.query);var r=this.state.caseSensitive;var a=this.state.phraseSearch;var s=i.length;if(s===0){return}if(!r){n=n.toLowerCase();i=i.toLowerCase()}if(a){this.calcFindPhraseMatch(i,t,n)}else{this.calcFindWordMatch(i,t,n)}this.updatePage(t);if(this.resumePageIdx===t){this.resumePageIdx=null;this.nextPageMatch()}if(this.pageMatches[t].length>0){this.matchCount+=this.pageMatches[t].length;this.updateUIResultsCount()}}},{key:"extractText",value:function e(){var t=this;if(this.startedTextExtraction){return}this.startedTextExtraction=true;this.pageContents.length=0;var n=Promise.resolve();var i=function e(i,a){var s=(0,r.createPromiseCapability)();t.extractTextPromises[i]=s.promise;n=n.then(function(){return t.pdfViewer.getPageTextContent(i).then(function(e){var n=e.items;var r=[];for(var a=0,o=n.length;a<o;a++){r.push(n[a].str)}t.pageContents[i]=r.join("");s.resolve(i)},function(e){console.error("Unable to get page "+(i+1)+" text content",e);t.pageContents[i]="";s.resolve(i)})})};for(var a=0,s=this.pdfViewer.pagesCount;a<s;a++){i(a,s)}}},{key:"executeCommand",value:function e(t,n){var i=this;if(this.state===null||t!=="findagain"){this.dirtyMatch=true}this.state=n;this.updateUIState(o.PENDING);this._firstPagePromise.then(function(){i.extractText();clearTimeout(i.findTimeout);if(t==="find"){i.findTimeout=setTimeout(i.nextMatch.bind(i),c)}else{i.nextMatch()}})}},{key:"updatePage",value:function e(t){if(this.selected.pageIdx===t){this.pdfViewer.currentPageNumber=t+1}var n=this.pdfViewer.getPageView(t);if(n.textLayer){n.textLayer.updateMatches()}}},{key:"nextMatch",value:function e(){var t=this;var n=this.state.findPrevious;var i=this.pdfViewer.currentPageNumber-1;var r=this.pdfViewer.pagesCount;this.active=true;if(this.dirtyMatch){this.dirtyMatch=false;this.selected.pageIdx=this.selected.matchIdx=-1;this.offset.pageIdx=i;this.offset.matchIdx=null;this.hadMatch=false;this.resumePageIdx=null;this.pageMatches=[];this.matchCount=0;this.pageMatchesLength=null;for(var a=0;a<r;a++){this.updatePage(a);if(!(a in this.pendingFindMatches)){this.pendingFindMatches[a]=true;this.extractTextPromises[a].then(function(e){delete t.pendingFindMatches[e];t.calcFindMatch(e)})}}}if(this.state.query===""){this.updateUIState(o.FOUND);return}if(this.resumePageIdx){return}var s=this.offset;this.pagesToSearch=r;if(s.matchIdx!==null){var u=this.pageMatches[s.pageIdx].length;if(!n&&s.matchIdx+1<u||n&&s.matchIdx>0){this.hadMatch=true;s.matchIdx=n?s.matchIdx-1:s.matchIdx+1;this.updateMatch(true);return}this.advanceOffsetPage(n)}this.nextPageMatch()}},{key:"matchesReady",value:function e(t){var n=this.offset;var i=t.length;var r=this.state.findPrevious;if(i){this.hadMatch=true;n.matchIdx=r?i-1:0;this.updateMatch(true);return true}this.advanceOffsetPage(r);if(n.wrapped){n.matchIdx=null;if(this.pagesToSearch<0){this.updateMatch(false);return true}}return false}},{key:"updateMatchPosition",value:function e(t,n,i,r){if(this.selected.matchIdx===n&&this.selected.pageIdx===t){var s={top:u,left:l};(0,a.scrollIntoView)(i[r],s,true)}}},{key:"nextPageMatch",value:function e(){if(this.resumePageIdx!==null){console.error("There can only be one pending page.")}var t=null;do{var n=this.offset.pageIdx;t=this.pageMatches[n];if(!t){this.resumePageIdx=n;break}}while(!this.matchesReady(t))}},{key:"advanceOffsetPage",value:function e(t){var n=this.offset;var i=this.extractTextPromises.length;n.pageIdx=t?n.pageIdx-1:n.pageIdx+1;n.matchIdx=null;this.pagesToSearch--;if(n.pageIdx>=i||n.pageIdx<0){n.pageIdx=t?i-1:0;n.wrapped=true}}},{key:"updateMatch",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var n=o.NOT_FOUND;var i=this.offset.wrapped;this.offset.wrapped=false;if(t){var r=this.selected.pageIdx;this.selected.pageIdx=this.offset.pageIdx;this.selected.matchIdx=this.offset.matchIdx;n=i?o.WRAPPED:o.FOUND;if(r!==-1&&r!==this.selected.pageIdx){this.updatePage(r)}}this.updateUIState(n,this.state.findPrevious);if(this.selected.pageIdx!==-1){this.updatePage(this.selected.pageIdx)}}},{key:"updateUIResultsCount",value:function e(){if(this.onUpdateResultsCount){this.onUpdateResultsCount(this.matchCount)}}},{key:"updateUIState",value:function e(t,n){if(this.onUpdateState){this.onUpdateState(t,n,this.matchCount)}}}]);return e}();t.FindState=o;t.PDFFindController=h},function(e,t,n){"use strict";var i="about:blank";var r=void 0;{r=n(4)}{n(28)}{n(33)}function a(e){return{appContainer:document.body,mainContainer:document.getElementById("viewerContainer"+e),viewerContainer:document.getElementById("viewer"+e),eventBus:null,toolbar:{container:document.getElementById("toolbarViewer"+e),numPages:document.getElementById("numPages"+e),pageNumber:document.getElementById("pageNumber"+e),scaleSelectContainer:document.getElementById("scaleSelectContainer"+e),scaleSelect:document.getElementById("scaleSelect"+e),customScaleOption:document.getElementById("customScaleOption"+e),previous:document.getElementById("previous"+e),next:document.getElementById("next"+e),zoomIn:document.getElementById("zoomIn"+e),zoomOut:document.getElementById("zoomOut"+e),viewFind:document.getElementById("viewFind"+e),openFile:document.getElementById("openFile"+e),print:document.getElementById("print"+e),presentationModeButton:document.getElementById("presentationMode"+e),download:document.getElementById("download"+e),viewBookmark:document.getElementById("viewBookmark"+e)},secondaryToolbar:{toolbar:document.getElementById("secondaryToolbar"+e),toggleButton:document.getElementById("secondaryToolbarToggle"+e),toolbarButtonContainer:document.getElementById("secondaryToolbarButtonContainer"+e),presentationModeButton:document.getElementById("secondaryPresentationMode"+e),openFileButton:document.getElementById("secondaryOpenFile"+e),printButton:document.getElementById("secondaryPrint"+e),downloadButton:document.getElementById("secondaryDownload"+e),viewBookmarkButton:document.getElementById("secondaryViewBookmark"+e),firstPageButton:document.getElementById("firstPage"+e),lastPageButton:document.getElementById("lastPage"+e),pageRotateCwButton:document.getElementById("pageRotateCw"+e),pageRotateCcwButton:document.getElementById("pageRotateCcw"+e),cursorSelectToolButton:document.getElementById("cursorSelectTool"+e),cursorHandToolButton:document.getElementById("cursorHandTool"+e),documentPropertiesButton:document.getElementById("documentProperties"+e)},fullscreen:{contextFirstPage:document.getElementById("contextFirstPage"+e),contextLastPage:document.getElementById("contextLastPage"+e),contextPageRotateCw:document.getElementById("contextPageRotateCw"+e),contextPageRotateCcw:document.getElementById("contextPageRotateCcw"+e)},sidebar:{mainContainer:document.getElementById("mainContainer"+e),outerContainer:document.getElementById("outerContainer"+e),toggleButton:document.getElementById("sidebarToggle"+e),thumbnailButton:document.getElementById("viewThumbnail"+e),outlineButton:document.getElementById("viewOutline"+e),attachmentsButton:document.getElementById("viewAttachments"+e),thumbnailView:document.getElementById("thumbnailView"+e),outlineView:document.getElementById("outlineView"+e),attachmentsView:document.getElementById("attachmentsView"+e)},findBar:{bar:document.getElementById("findbar"+e),toggleButton:document.getElementById("viewFind"+e),findField:document.getElementById("findInput"+e),highlightAllCheckbox:document.getElementById("findHighlightAll"+e),caseSensitiveCheckbox:document.getElementById("findMatchCase"+e),findMsg:document.getElementById("findMsg"+e),findResultsCount:document.getElementById("findResultsCount"+e),findStatusIcon:document.getElementById("findStatusIcon"+e),findPreviousButton:document.getElementById("findPrevious"+e),findNextButton:document.getElementById("findNext"+e)},passwordOverlay:{overlayName:"passwordOverlay",container:document.getElementById("passwordOverlay"+e),label:document.getElementById("passwordText"+e),input:document.getElementById("password"+e),submitButton:document.getElementById("passwordSubmit"+e),cancelButton:document.getElementById("passwordCancel"+e)},documentProperties:{overlayName:"documentPropertiesOverlay",container:document.getElementById("documentPropertiesOverlay"+e),closeButton:document.getElementById("documentPropertiesClose"+e),fields:{fileName:document.getElementById("fileNameField"+e),fileSize:document.getElementById("fileSizeField"+e),title:document.getElementById("titleField"+e),author:document.getElementById("authorField"+e),subject:document.getElementById("subjectField"+e),keywords:document.getElementById("keywordsField"+e),creationDate:document.getElementById("creationDateField"+e),modificationDate:document.getElementById("modificationDateField"+e),creator:document.getElementById("creatorField"+e),producer:document.getElementById("producerField"+e),version:document.getElementById("versionField"+e),pageCount:document.getElementById("pageCountField"+e)}},errorWrapper:{container:document.getElementById("errorWrapper"+e),errorMessage:document.getElementById("errorMessage"+e),closeButton:document.getElementById("errorClose"+e),errorMoreInfo:document.getElementById("errorMoreInfo"+e),moreInfoButton:document.getElementById("errorShowMore"+e),lessInfoButton:document.getElementById("errorShowLess"+e)},printContainer:document.getElementById("printContainer"+e),openFileInputName:"fileInput",debuggerScriptPath:"./debugger.js",defaultUrl:window.pdfJsFilePath||i}}function s(){var e=window.pdfJsViewerId;var t=a(e);window.PDFViewerApplication=r.PDFViewerApplication;r.PDFViewerApplication.run(t);if(r.PDFViewerApplication.overlayManager){r.PDFViewerApplication.overlayManager.active=null}}if(document.readyState==="interactive"||document.readyState==="complete"){s()}else{document.addEventListener("DOMContentLoaded",s,true)}document.addEventListener("PdfJsChangeSource",s,true)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});function i(e){this.element=e.element;this.document=e.element.ownerDocument;if(typeof e.ignoreTarget==="function"){this.ignoreTarget=e.ignoreTarget}this.onActiveChanged=e.onActiveChanged;this.activate=this.activate.bind(this);this.deactivate=this.deactivate.bind(this);this.toggle=this.toggle.bind(this);this._onmousedown=this._onmousedown.bind(this);this._onmousemove=this._onmousemove.bind(this);this._endPan=this._endPan.bind(this);var t=this.overlay=document.createElement("div");t.className="grab-to-pan-grabbing"}i.prototype={CSS_CLASS_GRAB:"grab-to-pan-grab",activate:function e(){if(!this.active){this.active=true;this.element.addEventListener("mousedown",this._onmousedown,true);this.element.classList.add(this.CSS_CLASS_GRAB);if(this.onActiveChanged){this.onActiveChanged(true)}}},deactivate:function e(){if(this.active){this.active=false;this.element.removeEventListener("mousedown",this._onmousedown,true);this._endPan();this.element.classList.remove(this.CSS_CLASS_GRAB);if(this.onActiveChanged){this.onActiveChanged(false)}}},toggle:function e(){if(this.active){this.deactivate()}else{this.activate()}},ignoreTarget:function e(t){return t[r]("a[href], a[href] *, input, textarea, button, button *, select, option")},_onmousedown:function e(t){if(t.button!==0||this.ignoreTarget(t.target)){return}if(t.originalTarget){try{t.originalTarget.tagName}catch(e){return}}this.scrollLeftStart=this.element.scrollLeft;this.scrollTopStart=this.element.scrollTop;this.clientXStart=t.clientX;this.clientYStart=t.clientY;this.document.addEventListener("mousemove",this._onmousemove,true);this.document.addEventListener("mouseup",this._endPan,true);this.element.addEventListener("scroll",this._endPan,true);t.preventDefault();t.stopPropagation();var n=document.activeElement;if(n&&!n.contains(t.target)){n.blur()}},_onmousemove:function e(t){this.element.removeEventListener("scroll",this._endPan,true);if(l(t)){this._endPan();return}var n=t.clientX-this.clientXStart;var i=t.clientY-this.clientYStart;var r=this.scrollTopStart-i;var a=this.scrollLeftStart-n;if(this.element.scrollTo){this.element.scrollTo({top:r,left:a,behavior:"instant"})}else{this.element.scrollTop=r;this.element.scrollLeft=a}if(!this.overlay.parentNode){document.body.appendChild(this.overlay)}},_endPan:function e(){this.element.removeEventListener("scroll",this._endPan,true);this.document.removeEventListener("mousemove",this._onmousemove,true);this.document.removeEventListener("mouseup",this._endPan,true);this.overlay.remove()}};var r;["webkitM","mozM","msM","oM","m"].some(function(e){var t=e+"atches";if(t in document.documentElement){r=t}t+="Selector";if(t in document.documentElement){r=t}return r});var a=!document.documentMode||document.documentMode>9;var s=window.chrome;var o=s&&(s.webstore||s.app);var u=/Apple/.test(navigator.vendor)&&/Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);function l(e){if("buttons"in e&&a){return!(e.buttons&1)}if(o||u){return e.which===0}}t.GrabToPan=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFSidebar=t.SidebarView=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(0);var a=n(3);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o="pdfSidebarNotification";var u={NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3};var l=function(){function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:r.NullL10n;s(this,e);this.isOpen=false;this.active=u.THUMBS;this.isInitialViewSet=false;this.onToggled=null;this.pdfViewer=t.pdfViewer;this.pdfThumbnailViewer=t.pdfThumbnailViewer;this.pdfOutlineViewer=t.pdfOutlineViewer;this.mainContainer=t.mainContainer;this.outerContainer=t.outerContainer;this.eventBus=t.eventBus;this.toggleButton=t.toggleButton;this.thumbnailButton=t.thumbnailButton;this.outlineButton=t.outlineButton;this.attachmentsButton=t.attachmentsButton;this.thumbnailView=t.thumbnailView;this.outlineView=t.outlineView;this.attachmentsView=t.attachmentsView;this.disableNotification=t.disableNotification||false;this.l10n=n;this._addEventListeners()}i(e,[{key:"reset",value:function e(){this.isInitialViewSet=false;this._hideUINotification(null);this.switchView(u.THUMBS);this.outlineButton.disabled=false;this.attachmentsButton.disabled=false}},{key:"setInitialView",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:u.NONE;if(this.isInitialViewSet){return}this.isInitialViewSet=true;if(this.isOpen&&t===u.NONE){this._dispatchEvent();return}var n=t===this.visibleView;this.switchView(t,true);if(n){this._dispatchEvent()}}},{key:"switchView",value:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(t===u.NONE){this.close();return}var i=t!==this.active;var r=false;switch(t){case u.THUMBS:this.thumbnailButton.classList.add("toggled");this.outlineButton.classList.remove("toggled");this.attachmentsButton.classList.remove("toggled");this.thumbnailView.classList.remove("hidden");this.outlineView.classList.add("hidden");this.attachmentsView.classList.add("hidden");if(this.isOpen&&i){this._updateThumbnailViewer();r=true}break;case u.OUTLINE:if(this.outlineButton.disabled){return}this.thumbnailButton.classList.remove("toggled");this.outlineButton.classList.add("toggled");this.attachmentsButton.classList.remove("toggled");this.thumbnailView.classList.add("hidden");this.outlineView.classList.remove("hidden");this.attachmentsView.classList.add("hidden");break;case u.ATTACHMENTS:if(this.attachmentsButton.disabled){return}this.thumbnailButton.classList.remove("toggled");this.outlineButton.classList.remove("toggled");this.attachmentsButton.classList.add("toggled");this.thumbnailView.classList.add("hidden");this.outlineView.classList.add("hidden");this.attachmentsView.classList.remove("hidden");break;default:console.error('PDFSidebar_switchView: "'+t+'" is an unsupported value.');return}this.active=t|0;if(n&&!this.isOpen){this.open();return}if(r){this._forceRendering()}if(i){this._dispatchEvent()}this._hideUINotification(this.active)}},{key:"open",value:function e(){if(this.isOpen){return}this.isOpen=true;this.toggleButton.classList.add("toggled");this.outerContainer.classList.add("sidebarMoving");this.outerContainer.classList.add("sidebarOpen");if(this.active===u.THUMBS){this._updateThumbnailViewer()}this._forceRendering();this._dispatchEvent();this._hideUINotification(this.active)}},{key:"close",value:function e(){if(!this.isOpen){return}this.isOpen=false;this.toggleButton.classList.remove("toggled");this.outerContainer.classList.add("sidebarMoving");this.outerContainer.classList.remove("sidebarOpen");this._forceRendering();this._dispatchEvent()}},{key:"toggle",value:function e(){if(this.isOpen){this.close()}else{this.open()}}},{key:"_dispatchEvent",value:function e(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.visibleView})}},{key:"_forceRendering",value:function e(){if(this.onToggled){this.onToggled()}else{this.pdfViewer.forceRendering();this.pdfThumbnailViewer.forceRendering()}}},{key:"_updateThumbnailViewer",value:function e(){var t=this.pdfViewer,n=this.pdfThumbnailViewer;var i=t.pagesCount;for(var r=0;r<i;r++){var s=t.getPageView(r);if(s&&s.renderingState===a.RenderingStates.FINISHED){var o=n.getThumbnail(r);o.setImage(s)}}n.scrollThumbnailIntoView(t.currentPageNumber)}},{key:"_showUINotification",value:function e(t){var n=this;if(this.disableNotification){return}this.l10n.get("toggle_sidebar_notification.title",null,"Toggle Sidebar (document contains outline/attachments)").then(function(e){n.toggleButton.title=e});if(!this.isOpen){this.toggleButton.classList.add(o)}else if(t===this.active){return}switch(t){case u.OUTLINE:this.outlineButton.classList.add(o);break;case u.ATTACHMENTS:this.attachmentsButton.classList.add(o);break}}},{key:"_hideUINotification",value:function e(t){var n=this;if(this.disableNotification){return}var i=function e(t){switch(t){case u.OUTLINE:n.outlineButton.classList.remove(o);break;case u.ATTACHMENTS:n.attachmentsButton.classList.remove(o);break}};if(!this.isOpen&&t!==null){return}this.toggleButton.classList.remove(o);if(t!==null){i(t);return}for(t in u){i(u[t])}this.l10n.get("toggle_sidebar.title",null,"Toggle Sidebar").then(function(e){n.toggleButton.title=e})}},{key:"_addEventListeners",value:function e(){var t=this;this.mainContainer.addEventListener("transitionend",function(e){if(e.target===t.mainContainer){t.outerContainer.classList.remove("sidebarMoving")}});this.thumbnailButton.addEventListener("click",function(){t.switchView(u.THUMBS)});this.outlineButton.addEventListener("click",function(){t.switchView(u.OUTLINE)});this.outlineButton.addEventListener("dblclick",function(){t.pdfOutlineViewer.toggleOutlineTree()});this.attachmentsButton.addEventListener("click",function(){t.switchView(u.ATTACHMENTS)});this.eventBus.on("outlineloaded",function(e){var n=e.outlineCount;t.outlineButton.disabled=!n;if(n){t._showUINotification(u.OUTLINE)}else if(t.active===u.OUTLINE){t.switchView(u.THUMBS)}});this.eventBus.on("attachmentsloaded",function(e){if(e.attachmentsCount){t.attachmentsButton.disabled=false;t._showUINotification(u.ATTACHMENTS);return}Promise.resolve().then(function(){if(t.attachmentsView.hasChildNodes()){return}t.attachmentsButton.disabled=true;if(t.active===u.ATTACHMENTS){t.switchView(u.THUMBS)}})});this.eventBus.on("presentationmodechanged",function(e){if(!e.active&&!e.switchInProgress&&t.isThumbnailViewVisible){t._updateThumbnailViewer()}})}},{key:"visibleView",get:function e(){return this.isOpen?this.active:u.NONE}},{key:"isThumbnailViewVisible",get:function e(){return this.isOpen&&this.active===u.THUMBS}},{key:"isOutlineViewVisible",get:function e(){return this.isOpen&&this.active===u.OUTLINE}},{key:"isAttachmentsViewVisible",get:function e(){return this.isOpen&&this.active===u.ATTACHMENTS}}]);return e}();t.SidebarView=u;t.PDFSidebar=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFViewer=t.PresentationModeState=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(1);var a=n(0);var s=n(3);var o=n(12);var u=n(2);var l=n(13);var c=n(5);var d=n(14);function h(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var f={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};var v=10;function g(e){var t=[];this.push=function n(i){var r=t.indexOf(i);if(r>=0){t.splice(r,1)}t.push(i);if(t.length>e){t.shift().destroy()}};this.resize=function(n){e=n;while(t.length>e){t.shift().destroy()}}}function p(e,t){if(t===e){return true}if(Math.abs(t-e)<1e-15){return true}return false}function m(e){return e.width<=e.height}var w=function(){function e(t){h(this,e);this.container=t.container;this.viewer=t.viewer||t.container.firstElementChild;this.eventBus=t.eventBus||(0,u.getGlobalEventBus)();this.linkService=t.linkService||new c.SimpleLinkService;this.downloadManager=t.downloadManager||null;this.removePageBorders=t.removePageBorders||false;this.enhanceTextSelection=t.enhanceTextSelection||false;this.renderInteractiveForms=t.renderInteractiveForms||false;this.enablePrintAutoRotate=t.enablePrintAutoRotate||true;this.renderer=t.renderer||a.RendererType.CANVAS;this.l10n=t.l10n||a.NullL10n;this.defaultRenderingQueue=!t.renderingQueue;if(this.defaultRenderingQueue){this.renderingQueue=new s.PDFRenderingQueue;this.renderingQueue.setViewer(this)}else{this.renderingQueue=t.renderingQueue}this.scroll=(0,a.watchScroll)(this.container,this._scrollUpdate.bind(this));this.presentationModeState=f.UNKNOWN;this._resetView();if(this.removePageBorders){this.viewer.classList.add("removePageBorders")}}i(e,[{key:"getPageView",value:function e(t){return this._pages[t]}},{key:"_setCurrentPageNumber",value:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this._currentPageNumber===t){if(n){this._resetCurrentPageView()}return}if(!(0<t&&t<=this.pagesCount)){return}var i={source:this,pageNumber:t,pageLabel:this._pageLabels&&this._pageLabels[t-1]};this._currentPageNumber=t;this.eventBus.dispatch("pagechanging",i);this.eventBus.dispatch("pagechange",i);if(n){this._resetCurrentPageView()}}},{key:"setDocument",value:function e(t){var n=this;if(this.pdfDocument){this._cancelRendering();this._resetView()}this.pdfDocument=t;if(!t){return}var i=t.numPages;var s=(0,r.createPromiseCapability)();this.pagesPromise=s.promise;s.promise.then(function(){n._pageViewsReady=true;n.eventBus.dispatch("pagesloaded",{source:n,pagesCount:i})});var o=false;var u=(0,r.createPromiseCapability)();this.onePageRendered=u.promise;var c=function e(t){t.onBeforeDraw=function(){n._buffer.push(t)};t.onAfterDraw=function(){if(!o){o=true;u.resolve()}}};var d=t.getPage(1);this.firstPagePromise=d;d.then(function(e){var o=n.currentScale;var d=e.getViewport(o*a.CSS_UNITS);for(var h=1;h<=i;++h){var f=null;if(!r.PDFJS.disableTextLayer){f=n}var v=new l.PDFPageView({container:n.viewer,eventBus:n.eventBus,id:h,scale:o,defaultViewport:d.clone(),renderingQueue:n.renderingQueue,textLayerFactory:f,annotationLayerFactory:n,enhanceTextSelection:n.enhanceTextSelection,renderInteractiveForms:n.renderInteractiveForms,renderer:n.renderer,l10n:n.l10n});c(v);n._pages.push(v)}u.promise.then(function(){if(r.PDFJS.disableAutoFetch){s.resolve();return}var e=i;var a=function i(r){t.getPage(r).then(function(t){var i=n._pages[r-1];if(!i.pdfPage){i.setPdfPage(t)}n.linkService.cachePageRef(r,t.ref);if(--e===0){s.resolve()}},function(t){console.error("Unable to get page "+r+" to initialize viewer",t);if(--e===0){s.resolve()}})};for(var o=1;o<=i;++o){a(o)}});n.eventBus.dispatch("pagesinit",{source:n});if(n.defaultRenderingQueue){n.update()}if(n.findController){n.findController.resolveFirstPage()}}).catch(function(e){console.error("Unable to initialize viewer",e)})}},{key:"setPageLabels",value:function e(t){if(!this.pdfDocument){return}if(!t){this._pageLabels=null}else if(!(t instanceof Array&&this.pdfDocument.numPages===t.length)){this._pageLabels=null;console.error("PDFViewer.setPageLabels: Invalid page labels.")}else{this._pageLabels=t}for(var n=0,i=this._pages.length;n<i;n++){var r=this._pages[n];var a=this._pageLabels&&this._pageLabels[n];r.setPageLabel(a)}}},{key:"_resetView",value:function e(){this._pages=[];this._currentPageNumber=1;this._currentScale=a.UNKNOWN_SCALE;this._currentScaleValue=null;this._pageLabels=null;this._buffer=new g(v);this._location=null;this._pagesRotation=0;this._pagesRequests=[];this._pageViewsReady=false;this.viewer.textContent=""}},{key:"_scrollUpdate",value:function e(){if(this.pagesCount===0){return}this.update()}},{key:"_setScaleDispatchEvent",value:function e(t,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var r={source:this,scale:t,presetValue:i?n:undefined};this.eventBus.dispatch("scalechanging",r);this.eventBus.dispatch("scalechange",r)}},{key:"_setScaleUpdatePages",value:function e(t,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;this._currentScaleValue=n.toString();if(p(this._currentScale,t)){if(a){this._setScaleDispatchEvent(t,n,true)}return}for(var s=0,o=this._pages.length;s<o;s++){this._pages[s].update(t)}this._currentScale=t;if(!i){var u=this._currentPageNumber,l=void 0;if(this._location&&!r.PDFJS.ignoreCurrentPositionOnZoom&&!(this.isInPresentationMode||this.isChangingPresentationMode)){u=this._location.pageNumber;l=[null,{name:"XYZ"},this._location.left,this._location.top,null]}this.scrollPageIntoView({pageNumber:u,destArray:l,allowNegativeOffset:true})}this._setScaleDispatchEvent(t,n,a);if(this.defaultRenderingQueue){this.update()}}},{key:"_setScale",value:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i=parseFloat(t);if(i>0){this._setScaleUpdatePages(i,t,n,false)}else{var r=this._pages[this._currentPageNumber-1];if(!r){return}var s=this.isInPresentationMode||this.removePageBorders?0:a.SCROLLBAR_PADDING;var o=this.isInPresentationMode||this.removePageBorders?0:a.VERTICAL_PADDING;var u=(this.container.clientWidth-s)/r.width*r.scale;var l=(this.container.clientHeight-o)/r.height*r.scale;switch(t){case"page-actual":i=1;break;case"page-width":i=u;break;case"page-height":i=l;break;case"page-fit":i=Math.min(u,l);break;case"auto":var c=r.width>r.height;var d=c?Math.min(l,u):u;i=Math.min(a.MAX_AUTO_SCALE,d);break;default:console.error('PDFViewer._setScale: "'+t+'" is an unknown zoom value.');return}this._setScaleUpdatePages(i,t,n,true)}}},{key:"_resetCurrentPageView",value:function e(){if(this.isInPresentationMode){this._setScale(this._currentScaleValue,true)}var t=this._pages[this._currentPageNumber-1];(0,a.scrollIntoView)(t.div)}},{key:"scrollPageIntoView",value:function e(t){if(arguments.length>1||typeof t==="number"){console.error("Call of scrollPageIntoView() with obsolete signature.");return}if(!this.pdfDocument){return}var n=t.pageNumber||0;var i=t.destArray||null;var r=t.allowNegativeOffset||false;if(this.isInPresentationMode||!i){this._setCurrentPageNumber(n,true);return}var s=this._pages[n-1];if(!s){console.error('PDFViewer.scrollPageIntoView: Invalid "pageNumber" parameter.');return}var o=0,u=0;var l=0,c=0,d=void 0,h=void 0;var f=s.rotation%180===0?false:true;var v=(f?s.height:s.width)/s.scale/a.CSS_UNITS;var g=(f?s.width:s.height)/s.scale/a.CSS_UNITS;var p=0;switch(i[1].name){case"XYZ":o=i[2];u=i[3];p=i[4];o=o!==null?o:0;u=u!==null?u:g;break;case"Fit":case"FitB":p="page-fit";break;case"FitH":case"FitBH":u=i[2];p="page-width";if(u===null&&this._location){o=this._location.left;u=this._location.top}break;case"FitV":case"FitBV":o=i[2];l=v;c=g;p="page-height";break;case"FitR":o=i[2];u=i[3];l=i[4]-o;c=i[5]-u;var m=this.removePageBorders?0:a.SCROLLBAR_PADDING;var w=this.removePageBorders?0:a.VERTICAL_PADDING;d=(this.container.clientWidth-m)/l/a.CSS_UNITS;h=(this.container.clientHeight-w)/c/a.CSS_UNITS;p=Math.min(Math.abs(d),Math.abs(h));break;default:console.error('PDFViewer.scrollPageIntoView: "'+i[1].name+'" '+"is not a valid destination type.");return}if(p&&p!==this._currentScale){this.currentScaleValue=p}else if(this._currentScale===a.UNKNOWN_SCALE){this.currentScaleValue=a.DEFAULT_SCALE_VALUE}if(p==="page-fit"&&!i[4]){(0,a.scrollIntoView)(s.div);return}var b=[s.viewport.convertToViewportPoint(o,u),s.viewport.convertToViewportPoint(o+l,u+c)];var y=Math.min(b[0][0],b[1][0]);var P=Math.min(b[0][1],b[1][1]);if(!r){y=Math.max(y,0);P=Math.max(P,0)}(0,a.scrollIntoView)(s.div,{left:y,top:P})}},{key:"_updateLocation",value:function e(t){var n=this._currentScale;var i=this._currentScaleValue;var r=parseFloat(i)===n?Math.round(n*1e4)/100:i;var a=t.id;var s="#page="+a;s+="&zoom="+r;var o=this._pages[a-1];var u=this.container;var l=o.getPagePoint(u.scrollLeft-t.x,u.scrollTop-t.y);var c=Math.round(l[0]);var d=Math.round(l[1]);s+=","+c+","+d;this._location={pageNumber:a,scale:r,top:d,left:c,pdfOpenParams:s}}},{key:"update",value:function e(){var t=this._getVisiblePages();var n=t.views;if(n.length===0){return}var i=Math.max(v,2*n.length+1);this._buffer.resize(i);this.renderingQueue.renderHighestPriority(t);var r=this._currentPageNumber;var a=t.first;var s=false;for(var o=0,u=n.length;o<u;++o){var l=n[o];if(l.percent<100){break}if(l.id===r){s=true;break}}if(!s){r=n[0].id}if(!this.isInPresentationMode){this._setCurrentPageNumber(r)}this._updateLocation(a);this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}},{key:"containsElement",value:function e(t){return this.container.contains(t)}},{key:"focus",value:function e(){this.container.focus()}},{key:"_getVisiblePages",value:function e(){if(!this.isInPresentationMode){return(0,a.getVisibleElements)(this.container,this._pages,true)}var t=[];var n=this._pages[this._currentPageNumber-1];t.push({id:n.id,view:n});return{first:n,last:n,views:t}}},{key:"cleanup",value:function e(){for(var t=0,n=this._pages.length;t<n;t++){if(this._pages[t]&&this._pages[t].renderingState!==s.RenderingStates.FINISHED){this._pages[t].reset()}}}},{key:"_cancelRendering",value:function e(){for(var t=0,n=this._pages.length;t<n;t++){if(this._pages[t]){this._pages[t].cancelRendering()}}}},{key:"_ensurePdfPageLoaded",value:function e(t){var n=this;if(t.pdfPage){return Promise.resolve(t.pdfPage)}var i=t.id;if(this._pagesRequests[i]){return this._pagesRequests[i]}var r=this.pdfDocument.getPage(i).then(function(e){if(!t.pdfPage){t.setPdfPage(e)}n._pagesRequests[i]=null;return e}).catch(function(e){console.error("Unable to get page for page view",e);n._pagesRequests[i]=null});this._pagesRequests[i]=r;return r}},{key:"forceRendering",value:function e(t){var n=this;var i=t||this._getVisiblePages();var r=this.renderingQueue.getHighestPriority(i,this._pages,this.scroll.down);if(r){this._ensurePdfPageLoaded(r).then(function(){n.renderingQueue.renderView(r)});return true}return false}},{key:"getPageTextContent",value:function e(t){return this.pdfDocument.getPage(t+1).then(function(e){return e.getTextContent({normalizeWhitespace:true})})}},{key:"createTextLayerBuilder",value:function e(t,n,i){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return new d.TextLayerBuilder({textLayerDiv:t,eventBus:this.eventBus,pageIndex:n,viewport:i,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:this.isInPresentationMode?false:r})}},{key:"createAnnotationLayerBuilder",value:function e(t,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:a.NullL10n;return new o.AnnotationLayerBuilder({pageDiv:t,pdfPage:n,renderInteractiveForms:i,linkService:this.linkService,downloadManager:this.downloadManager,l10n:r})}},{key:"setFindController",value:function e(t){this.findController=t}},{key:"getPagesOverview",value:function e(){var t=this._pages.map(function(e){var t=e.pdfPage.getViewport(1);return{width:t.width,height:t.height,rotation:t.rotation}});if(!this.enablePrintAutoRotate){return t}var n=m(t[0]);return t.map(function(e){if(n===m(e)){return e}return{width:e.height,height:e.width,rotation:(e.rotation+90)%360}})}},{key:"pagesCount",get:function e(){return this._pages.length}},{key:"pageViewsReady",get:function e(){return this._pageViewsReady}},{key:"currentPageNumber",get:function e(){return this._currentPageNumber},set:function e(t){if((t|0)!==t){throw new Error("Invalid page number.")}if(!this.pdfDocument){return}this._setCurrentPageNumber(t,true)}},{key:"currentPageLabel",get:function e(){return this._pageLabels&&this._pageLabels[this._currentPageNumber-1]},set:function e(t){var n=t|0;if(this._pageLabels){var i=this._pageLabels.indexOf(t);if(i>=0){n=i+1}}this.currentPageNumber=n}},{key:"currentScale",get:function e(){return this._currentScale!==a.UNKNOWN_SCALE?this._currentScale:a.DEFAULT_SCALE},set:function e(t){if(isNaN(t)){throw new Error("Invalid numeric scale")}if(!this.pdfDocument){return}this._setScale(t,false)}},{key:"currentScaleValue",get:function e(){return this._currentScaleValue},set:function e(t){if(!this.pdfDocument){return}this._setScale(t,false)}},{key:"pagesRotation",get:function e(){return this._pagesRotation},set:function e(t){if(!(typeof t==="number"&&t%90===0)){throw new Error("Invalid pages rotation angle.")}if(!this.pdfDocument){return}this._pagesRotation=t;for(var n=0,i=this._pages.length;n<i;n++){var r=this._pages[n];r.update(r.scale,t)}this._setScale(this._currentScaleValue,true);if(this.defaultRenderingQueue){this.update()}}},{key:"isInPresentationMode",get:function e(){return this.presentationModeState===f.FULLSCREEN}},{key:"isChangingPresentationMode",get:function e(){return this.presentationModeState===f.CHANGING}},{key:"isHorizontalScrollbarEnabled",get:function e(){return this.isInPresentationMode?false:this.container.scrollWidth>this.container.clientWidth}},{key:"hasEqualPageSizes",get:function e(){var t=this._pages[0];for(var n=1,i=this._pages.length;n<i;++n){var r=this._pages[n];if(r.width!==t.width||r.height!==t.height){return false}}return true}}]);return e}();t.PresentationModeState=f;t.PDFViewer=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DefaultAnnotationLayerFactory=t.AnnotationLayerBuilder=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(1);var a=n(0);var s=n(5);function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(t){var n=t.pageDiv,i=t.pdfPage,r=t.linkService,s=t.downloadManager,u=t.renderInteractiveForms,l=u===undefined?false:u,c=t.l10n,d=c===undefined?a.NullL10n:c;o(this,e);this.pageDiv=n;this.pdfPage=i;this.linkService=r;this.downloadManager=s;this.renderInteractiveForms=l;this.l10n=d;this.div=null}i(e,[{key:"render",value:function e(t){var n=this;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"display";this.pdfPage.getAnnotations({intent:i}).then(function(e){var i={viewport:t.clone({dontFlip:true}),div:n.div,annotations:e,page:n.pdfPage,renderInteractiveForms:n.renderInteractiveForms,linkService:n.linkService,downloadManager:n.downloadManager};if(n.div){r.AnnotationLayer.update(i)}else{if(e.length===0){return}n.div=document.createElement("div");n.div.className="annotationLayer";n.pageDiv.appendChild(n.div);i.div=n.div;r.AnnotationLayer.render(i);n.l10n.translate(n.div)}})}},{key:"hide",value:function e(){if(!this.div){return}this.div.setAttribute("hidden","true")}}]);return e}();var l=function(){function e(){o(this,e)}i(e,[{key:"createAnnotationLayerBuilder",value:function e(t,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:a.NullL10n;return new u({pageDiv:t,pdfPage:n,renderInteractiveForms:i,linkService:new s.SimpleLinkService,l10n:r})}}]);return e}();t.AnnotationLayerBuilder=u;t.DefaultAnnotationLayerFactory=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFPageView=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(0);var a=n(1);var s=n(2);var o=n(3);function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=function(){function e(t){u(this,e);var n=t.container;var i=t.defaultViewport;this.id=t.id;this.renderingId="page"+this.id;this.pdfPage=null;this.pageLabel=null;this.rotation=0;this.scale=t.scale||r.DEFAULT_SCALE;this.viewport=i;this.pdfPageRotate=i.rotation;this.hasRestrictedScaling=false;this.enhanceTextSelection=t.enhanceTextSelection||false;this.renderInteractiveForms=t.renderInteractiveForms||false;this.eventBus=t.eventBus||(0,s.getGlobalEventBus)();this.renderingQueue=t.renderingQueue;this.textLayerFactory=t.textLayerFactory;this.annotationLayerFactory=t.annotationLayerFactory;this.renderer=t.renderer||r.RendererType.CANVAS;this.l10n=t.l10n||r.NullL10n;this.paintTask=null;this.paintedViewportMap=new WeakMap;this.renderingState=o.RenderingStates.INITIAL;this.resume=null;this.error=null;this.onBeforeDraw=null;this.onAfterDraw=null;this.annotationLayer=null;this.textLayer=null;this.zoomLayer=null;var a=document.createElement("div");a.className="page";a.style.width=Math.floor(this.viewport.width)+"px";a.style.height=Math.floor(this.viewport.height)+"px";a.setAttribute("data-page-number",this.id);this.div=a;n.appendChild(a)}i(e,[{key:"setPdfPage",value:function e(t){this.pdfPage=t;this.pdfPageRotate=t.rotate;var n=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport(this.scale*r.CSS_UNITS,n);this.stats=t.stats;this.reset()}},{key:"destroy",value:function e(){this.reset();if(this.pdfPage){this.pdfPage.cleanup()}}},{key:"_resetZoomLayer",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(!this.zoomLayer){return}var n=this.zoomLayer.firstChild;this.paintedViewportMap.delete(n);n.width=0;n.height=0;if(t){this.zoomLayer.remove()}this.zoomLayer=null}},{key:"reset",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;this.cancelRendering();var i=this.div;i.style.width=Math.floor(this.viewport.width)+"px";i.style.height=Math.floor(this.viewport.height)+"px";var r=i.childNodes;var a=t&&this.zoomLayer||null;var s=n&&this.annotationLayer&&this.annotationLayer.div||null;for(var o=r.length-1;o>=0;o--){var u=r[o];if(a===u||s===u){continue}i.removeChild(u)}i.removeAttribute("data-loaded");if(s){this.annotationLayer.hide()}else{this.annotationLayer=null}if(!a){if(this.canvas){this.paintedViewportMap.delete(this.canvas);this.canvas.width=0;this.canvas.height=0;delete this.canvas}this._resetZoomLayer()}if(this.svg){this.paintedViewportMap.delete(this.svg);delete this.svg}this.loadingIconDiv=document.createElement("div");this.loadingIconDiv.className="loadingIcon";i.appendChild(this.loadingIconDiv)}},{key:"update",value:function e(t,n){this.scale=t||this.scale;if(typeof n!=="undefined"){this.rotation=n}var i=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:this.scale*r.CSS_UNITS,rotation:i});if(this.svg){this.cssTransform(this.svg,true);this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:true});return}var s=false;if(this.canvas&&a.PDFJS.maxCanvasPixels>0){var o=this.outputScale;if((Math.floor(this.viewport.width)*o.sx|0)*(Math.floor(this.viewport.height)*o.sy|0)>a.PDFJS.maxCanvasPixels){s=true}}if(this.canvas){if(a.PDFJS.useOnlyCssZoom||this.hasRestrictedScaling&&s){this.cssTransform(this.canvas,true);this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:true});return}if(!this.zoomLayer&&!this.canvas.hasAttribute("hidden")){this.zoomLayer=this.canvas.parentNode;this.zoomLayer.style.position="absolute"}}if(this.zoomLayer){this.cssTransform(this.zoomLayer.firstChild)}this.reset(true,true)}},{key:"cancelRendering",value:function e(){if(this.paintTask){this.paintTask.cancel();this.paintTask=null}this.renderingState=o.RenderingStates.INITIAL;this.resume=null;if(this.textLayer){this.textLayer.cancel();this.textLayer=null}}},{key:"cssTransform",value:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i=this.viewport.width;var r=this.viewport.height;var s=this.div;t.style.width=t.parentNode.style.width=s.style.width=Math.floor(i)+"px";t.style.height=t.parentNode.style.height=s.style.height=Math.floor(r)+"px";var o=this.viewport.rotation-this.paintedViewportMap.get(t).rotation;var u=Math.abs(o);var l=1,c=1;if(u===90||u===270){l=r/i;c=i/r}var e="rotate("+o+"deg) "+"scale("+l+","+c+")";a.CustomStyle.setProp("transform",t,e);if(this.textLayer){var d=this.textLayer.viewport;var h=this.viewport.rotation-d.rotation;var f=Math.abs(h);var v=i/d.width;if(f===90||f===270){v=i/d.height}var g=this.textLayer.textLayerDiv;var p=void 0,m=void 0;switch(f){case 0:p=m=0;break;case 90:p=0;m="-"+g.style.height;break;case 180:p="-"+g.style.width;m="-"+g.style.height;break;case 270:p="-"+g.style.width;m=0;break;default:console.error("Bad rotation value.");break}a.CustomStyle.setProp("transform",g,"rotate("+f+"deg) "+"scale("+v+", "+v+") "+"translate("+p+", "+m+")");a.CustomStyle.setProp("transformOrigin",g,"0% 0%")}if(n&&this.annotationLayer){this.annotationLayer.render(this.viewport,"display")}}},{key:"getPagePoint",value:function e(t,n){return this.viewport.convertToPdfPoint(t,n)}},{key:"draw",value:function e(){var t=this;if(this.renderingState!==o.RenderingStates.INITIAL){console.error("Must be in new state before drawing");this.reset()}if(!this.pdfPage){this.renderingState=o.RenderingStates.FINISHED;return Promise.reject(new Error("Page is not loaded"))}this.renderingState=o.RenderingStates.RUNNING;var n=this.pdfPage;var i=this.div;var s=document.createElement("div");s.style.width=i.style.width;s.style.height=i.style.height;s.classList.add("canvasWrapper");if(this.annotationLayer&&this.annotationLayer.div){i.insertBefore(s,this.annotationLayer.div)}else{i.appendChild(s)}var u=null;if(this.textLayerFactory){var l=document.createElement("div");l.className="textLayer";l.style.width=s.style.width;l.style.height=s.style.height;if(this.annotationLayer&&this.annotationLayer.div){i.insertBefore(l,this.annotationLayer.div)}else{i.appendChild(l)}u=this.textLayerFactory.createTextLayerBuilder(l,this.id-1,this.viewport,this.enhanceTextSelection)}this.textLayer=u;var c=null;if(this.renderingQueue){c=function e(n){if(!t.renderingQueue.isHighestPriority(t)){t.renderingState=o.RenderingStates.PAUSED;t.resume=function(){t.renderingState=o.RenderingStates.RUNNING;n()};return}n()}}var d=function e(r){if(h===t.paintTask){t.paintTask=null}if(r==="cancelled"||r instanceof a.RenderingCancelledException){t.error=null;return Promise.resolve(undefined)}t.renderingState=o.RenderingStates.FINISHED;if(t.loadingIconDiv){i.removeChild(t.loadingIconDiv);delete t.loadingIconDiv}t._resetZoomLayer(true);t.error=r;t.stats=n.stats;if(t.onAfterDraw){t.onAfterDraw()}t.eventBus.dispatch("pagerendered",{source:t,pageNumber:t.id,cssTransform:false});if(r){return Promise.reject(r)}return Promise.resolve(undefined)};var h=this.renderer===r.RendererType.SVG?this.paintOnSvg(s):this.paintOnCanvas(s);h.onRenderContinue=c;this.paintTask=h;var f=h.promise.then(function(){return d(null).then(function(){if(u){var e=n.streamTextContent({normalizeWhitespace:true});u.setTextContentStream(e);u.render()}})},function(e){return d(e)});if(this.annotationLayerFactory){if(!this.annotationLayer){this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(i,n,this.renderInteractiveForms,this.l10n)}this.annotationLayer.render(this.viewport,"display")}i.setAttribute("data-loaded",true);if(this.onBeforeDraw){this.onBeforeDraw()}return f}},{key:"paintOnCanvas",value:function e(t){var n=(0,a.createPromiseCapability)();var i={promise:n.promise,onRenderContinue:function e(t){t()},cancel:function e(){b.cancel()}};var s=this.viewport;var o=document.createElement("canvas");o.id=this.renderingId;o.setAttribute("hidden","hidden");var u=true;var l=function e(){if(u){o.removeAttribute("hidden");u=false}};t.appendChild(o);this.canvas=o;o.mozOpaque=true;var c=o.getContext("2d",{alpha:false});var d=(0,r.getOutputScale)(c);this.outputScale=d;if(a.PDFJS.useOnlyCssZoom){var h=s.clone({scale:r.CSS_UNITS});d.sx*=h.width/s.width;d.sy*=h.height/s.height;d.scaled=true}if(a.PDFJS.maxCanvasPixels>0){var f=s.width*s.height;var v=Math.sqrt(a.PDFJS.maxCanvasPixels/f);if(d.sx>v||d.sy>v){d.sx=v;d.sy=v;d.scaled=true;this.hasRestrictedScaling=true}else{this.hasRestrictedScaling=false}}var g=(0,r.approximateFraction)(d.sx);var p=(0,r.approximateFraction)(d.sy);o.width=(0,r.roundToDivide)(s.width*d.sx,g[0]);o.height=(0,r.roundToDivide)(s.height*d.sy,p[0]);o.style.width=(0,r.roundToDivide)(s.width,g[1])+"px";o.style.height=(0,r.roundToDivide)(s.height,p[1])+"px";this.paintedViewportMap.set(o,s);var m=!d.scaled?null:[d.sx,0,0,d.sy,0,0];var w={canvasContext:c,transform:m,viewport:this.viewport,renderInteractiveForms:this.renderInteractiveForms};var b=this.pdfPage.render(w);b.onContinue=function(e){l();if(i.onRenderContinue){i.onRenderContinue(e)}else{e()}};b.promise.then(function(){l();n.resolve(undefined)},function(e){l();n.reject(e)});return i}},{key:"paintOnSvg",value:function e(t){var n=this;var i=false;var s=function e(){if(i){if(a.PDFJS.pdfjsNext){throw new a.RenderingCancelledException("Rendering cancelled, page "+n.id,"svg")}else{throw"cancelled"}}};var u=this.pdfPage;var l=this.viewport.clone({scale:r.CSS_UNITS});var c=u.getOperatorList().then(function(e){s();var i=new a.SVGGraphics(u.commonObjs,u.objs);return i.getSVG(e,l).then(function(e){s();n.svg=e;n.paintedViewportMap.set(e,l);e.style.width=t.style.width;e.style.height=t.style.height;n.renderingState=o.RenderingStates.FINISHED;t.appendChild(e)})});return{promise:c,onRenderContinue:function e(t){t()},cancel:function e(){i=true}}}},{key:"setPageLabel",value:function e(t){this.pageLabel=typeof t==="string"?t:null;if(this.pageLabel!==null){this.div.setAttribute("data-page-label",this.pageLabel)}else{this.div.removeAttribute("data-page-label")}}},{key:"width",get:function e(){return this.viewport.width}},{key:"height",get:function e(){return this.viewport.height}}]);return e}();t.PDFPageView=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DefaultTextLayerFactory=t.TextLayerBuilder=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(2);var a=n(1);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o=300;var u=function(){function e(t){var n=t.textLayerDiv,i=t.eventBus,a=t.pageIndex,o=t.viewport,u=t.findController,l=u===undefined?null:u,c=t.enhanceTextSelection,d=c===undefined?false:c;s(this,e);this.textLayerDiv=n;this.eventBus=i||(0,r.getGlobalEventBus)();this.textContent=null;this.textContentItemsStr=[];this.textContentStream=null;this.renderingDone=false;this.pageIdx=a;this.pageNumber=this.pageIdx+1;this.matches=[];this.viewport=o;this.textDivs=[];this.findController=l;this.textLayerRenderTask=null;this.enhanceTextSelection=d;this._bindMouse()}i(e,[{key:"_finishRendering",value:function e(){this.renderingDone=true;if(!this.enhanceTextSelection){var t=document.createElement("div");t.className="endOfContent";this.textLayerDiv.appendChild(t)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}},{key:"render",value:function e(){var t=this;var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(!(this.textContent||this.textContentStream)||this.renderingDone){return}this.cancel();this.textDivs=[];var i=document.createDocumentFragment();this.textLayerRenderTask=(0,a.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:i,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:n,enhanceTextSelection:this.enhanceTextSelection});this.textLayerRenderTask.promise.then(function(){t.textLayerDiv.appendChild(i);t._finishRendering();t.updateMatches()},function(e){})}},{key:"cancel",value:function e(){if(this.textLayerRenderTask){this.textLayerRenderTask.cancel();this.textLayerRenderTask=null}}},{key:"setTextContentStream",value:function e(t){this.cancel();this.textContentStream=t}},{key:"setTextContent",value:function e(t){this.cancel();this.textContent=t}},{key:"convertMatches",value:function e(t,n){var i=0;var r=0;var a=this.textContentItemsStr;var s=a.length-1;var o=this.findController===null?0:this.findController.state.query.length;var u=[];if(!t){return u}for(var l=0,c=t.length;l<c;l++){var d=t[l];while(i!==s&&d>=r+a[i].length){r+=a[i].length;i++}if(i===a.length){console.error("Could not find a matching mapping")}var h={begin:{divIdx:i,offset:d-r}};if(n){d+=n[l]}else{d+=o}while(i!==s&&d>r+a[i].length){r+=a[i].length;i++}h.end={divIdx:i,offset:d-r};u.push(h)}return u}},{key:"renderMatches",value:function e(t){if(t.length===0){return}var n=this.textContentItemsStr;var i=this.textDivs;var r=null;var a=this.pageIdx;var s=this.findController===null?false:a===this.findController.selected.pageIdx;var o=this.findController===null?-1:this.findController.selected.matchIdx;var u=this.findController===null?false:this.findController.state.highlightAll;var l={divIdx:-1,offset:undefined};function c(e,t){var n=e.divIdx;i[n].textContent="";d(n,0,e.offset,t)}function d(e,t,r,a){var s=i[e];var o=n[e].substring(t,r);var u=document.createTextNode(o);if(a){var l=document.createElement("span");l.className=a;l.appendChild(u);s.appendChild(l);return}s.appendChild(u)}var h=o,f=h+1;if(u){h=0;f=t.length}else if(!s){return}for(var v=h;v<f;v++){var g=t[v];var p=g.begin;var m=g.end;var w=s&&v===o;var b=w?" selected":"";if(this.findController){this.findController.updateMatchPosition(a,v,i,p.divIdx)}if(!r||p.divIdx!==r.divIdx){if(r!==null){d(r.divIdx,r.offset,l.offset)}c(p)}else{d(r.divIdx,r.offset,p.offset)}if(p.divIdx===m.divIdx){d(p.divIdx,p.offset,m.offset,"highlight"+b)}else{d(p.divIdx,p.offset,l.offset,"highlight begin"+b);for(var y=p.divIdx+1,P=m.divIdx;y<P;y++){i[y].className="highlight middle"+b}c(m,"highlight end"+b)}r=m}if(r){d(r.divIdx,r.offset,l.offset)}}},{key:"updateMatches",value:function e(){if(!this.renderingDone){return}var t=this.matches;var n=this.textDivs;var i=this.textContentItemsStr;var r=-1;for(var a=0,s=t.length;a<s;a++){var o=t[a];var u=Math.max(r,o.begin.divIdx);for(var l=u,c=o.end.divIdx;l<=c;l++){var d=n[l];d.textContent=i[l];d.className=""}r=o.end.divIdx+1}if(this.findController===null||!this.findController.active){return}var h=void 0,f=void 0;if(this.findController!==null){h=this.findController.pageMatches[this.pageIdx]||null;f=this.findController.pageMatchesLength?this.findController.pageMatchesLength[this.pageIdx]||null:null}this.matches=this.convertMatches(h,f);this.renderMatches(this.matches)}},{key:"_bindMouse",value:function e(){var t=this;var n=this.textLayerDiv;var i=null;n.addEventListener("mousedown",function(e){if(t.enhanceTextSelection&&t.textLayerRenderTask){t.textLayerRenderTask.expandTextDivs(true);if(i){clearTimeout(i);i=null}return}var r=n.querySelector(".endOfContent");if(!r){return}var a=e.target!==n;a=a&&window.getComputedStyle(r).getPropertyValue("-moz-user-select")!=="none";if(a){var s=n.getBoundingClientRect();var o=Math.max(0,(e.pageY-s.top)/s.height);r.style.top=(o*100).toFixed(2)+"%"}r.classList.add("active")});n.addEventListener("mouseup",function(){if(t.enhanceTextSelection&&t.textLayerRenderTask){i=setTimeout(function(){if(t.textLayerRenderTask){t.textLayerRenderTask.expandTextDivs(false)}i=null},o);return}var e=n.querySelector(".endOfContent");if(!e){return}e.style.top="";e.classList.remove("active")})}}]);return e}();var l=function(){function e(){s(this,e)}i(e,[{key:"createTextLayerBuilder",value:function e(t,n,i){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return new u({textLayerDiv:t,pageIndex:n,viewport:i,enhanceTextSelection:r})}}]);return e}();t.TextLayerBuilder=u;t.DefaultTextLayerFactory=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var a=function(){function e(){r(this,e);this._overlays={};this._active=null;this._keyDownBound=this._keyDown.bind(this)}i(e,[{key:"register",value:function e(t,n){var i=this;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return new Promise(function(e){var s=void 0;if(!t||!n||!(s=n.parentNode)){throw new Error("Not enough parameters.")}else if(i._overlays[t]){throw new Error("The overlay is already registered.")}i._overlays[t]={element:n,container:s,callerCloseMethod:r,canForceClose:a};e()})}},{key:"unregister",value:function e(t){var n=this;return new Promise(function(e){if(!n._overlays[t]){throw new Error("The overlay does not exist.")}else if(n._active===t){throw new Error("The overlay cannot be removed while it is active.")}delete n._overlays[t];e()})}},{key:"open",value:function e(t){var n=this;return new Promise(function(e){if(!n._overlays[t]){throw new Error("The overlay does not exist.")}else if(n._active){if(n._overlays[t].canForceClose){n._closeThroughCaller()}else if(n._active===t){throw new Error("The overlay is already active.")}else{throw new Error("Another overlay is currently active.")}}n._active=t;n._overlays[n._active].element.classList.remove("hidden");n._overlays[n._active].container.classList.remove("hidden");window.addEventListener("keydown",n._keyDownBound);e()})}},{key:"close",value:function e(t){var n=this;return new Promise(function(e){if(!n._overlays[t]){throw new Error("The overlay does not exist.")}else if(!n._active){throw new Error("The overlay is currently not active.")}else if(n._active!==t){throw new Error("Another overlay is currently active.")}n._overlays[n._active].container.classList.add("hidden");n._overlays[n._active].element.classList.add("hidden");n._active=null;window.removeEventListener("keydown",n._keyDownBound);e()})}},{key:"_keyDown",value:function e(t){if(this._active&&t.keyCode===27){this._closeThroughCaller();t.preventDefault()}}},{key:"_closeThroughCaller",value:function e(){if(this._overlays[this._active].callerCloseMethod){this._overlays[this._active].callerCloseMethod()}if(this._active){this.close(this._active)}}},{key:"active",value:function e(){return this._active}}]);return e}();t.OverlayManager=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PasswordPrompt=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(0);var a=n(1);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function e(t,n){var i=this;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:r.NullL10n;s(this,e);this.overlayName=t.overlayName;this.container=t.container;this.label=t.label;this.input=t.input;this.submitButton=t.submitButton;this.cancelButton=t.cancelButton;this.overlayManager=n;this.l10n=a;this.updateCallback=null;this.reason=null;this.submitButton.addEventListener("click",this.verify.bind(this));this.cancelButton.addEventListener("click",this.close.bind(this));this.input.addEventListener("keydown",function(e){if(e.keyCode===13){i.verify()}});if(!this.overlayManager._overlays[this.overlayName]){this.overlayManager.register(this.overlayName,this.container,this.close.bind(this),true)}}i(e,[{key:"open",value:function e(){var t=this;this.overlayManager.open(this.overlayName).then(function(){t.input.focus();var e=void 0;if(t.reason===a.PasswordResponses.INCORRECT_PASSWORD){e=t.l10n.get("password_invalid",null,"Invalid password. Please try again.")}else{e=t.l10n.get("password_label",null,"Enter the password to open this PDF file.")}e.then(function(e){t.label.textContent=e})})}},{key:"close",value:function e(){var t=this;this.overlayManager.close(this.overlayName).then(function(){t.input.value=""})}},{key:"verify",value:function e(){var t=this.input.value;if(t&&t.length>0){this.close();return this.updateCallback(t)}}},{key:"setUpdateCallback",value:function e(t,n){this.updateCallback=t;this.reason=n}}]);return e}();t.PasswordPrompt=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFAttachmentViewer=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(1);function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t){var n=t.container,i=t.eventBus,r=t.downloadManager;a(this,e);this.container=n;this.eventBus=i;this.downloadManager=r;this.reset();this.eventBus.on("fileattachmentannotation",this._appendAttachment.bind(this))}i(e,[{key:"reset",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;this.attachments=null;this.container.textContent="";if(!t){this._renderedCapability=(0,r.createPromiseCapability)()}}},{key:"_dispatchEvent",value:function e(t){this._renderedCapability.resolve();this.eventBus.dispatch("attachmentsloaded",{source:this,attachmentsCount:t})}},{key:"_bindPdfLink",value:function e(t,n,i){if(r.PDFJS.disableCreateObjectURL){throw new Error("bindPdfLink: "+'Unsupported "PDFJS.disableCreateObjectURL" value.')}var a=void 0;t.onclick=function(){if(!a){a=(0,r.createObjectURL)(n,"application/pdf")}var e=void 0;e="?file="+encodeURIComponent(a+"#"+i);window.open(e);return false}}},{key:"_bindLink",value:function e(t,n,i){var r=this;t.onclick=function(){r.downloadManager.downloadData(n,i,"");return false}}},{key:"render",value:function e(t){var n=t.attachments,i=t.keepRenderedCapability,a=i===undefined?false:i;var s=0;if(this.attachments){this.reset(a===true)}this.attachments=n||null;if(!n){this._dispatchEvent(s);return}var o=Object.keys(n).sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())});s=o.length;for(var u=0;u<s;u++){var l=n[o[u]];var c=(0,r.removeNullCharacters)((0,r.getFilenameFromUrl)(l.filename));var d=document.createElement("div");d.className="attachmentsItem";var h=document.createElement("button");h.textContent=c;if(/\.pdf$/i.test(c)&&!r.PDFJS.disableCreateObjectURL){this._bindPdfLink(h,l.content,c)}else{this._bindLink(h,l.content,c)}d.appendChild(h);this.container.appendChild(d)}this._dispatchEvent(s)}},{key:"_appendAttachment",value:function e(t){var n=this;var i=t.id,r=t.filename,a=t.content;this._renderedCapability.promise.then(function(){var e=n.attachments;if(!e){e=Object.create(null)}else{for(var t in e){if(i===t){return}}}e[i]={filename:r,content:a};n.render({attachments:e,keepRenderedCapability:true})})}}]);return e}();t.PDFAttachmentViewer=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFDocumentProperties=undefined;var i=function(){function e(e,t){var n=[];var i=true;var r=false;var a=undefined;try{for(var s=e[Symbol.iterator](),o;!(i=(o=s.next()).done);i=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){r=true;a=e}finally{try{if(!i&&s["return"])s["return"]()}finally{if(r)throw a}}return n}return function(t,n){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,n)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var a=n(0);var s=n(1);function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u="-";var l=function(){function e(t,n){var i=t.overlayName,r=t.fields,s=t.container,u=t.closeButton;var l=arguments.length>2&&arguments[2]!==undefined?arguments[2]:a.NullL10n;o(this,e);this.overlayName=i;this.fields=r;this.container=s;this.overlayManager=n;this.l10n=l;this._reset();if(u){u.addEventListener("click",this.close.bind(this))}if(!this.overlayManager._overlays[this.overlayName]){this.overlayManager.register(this.overlayName,this.container,this.close.bind(this))}}r(e,[{key:"open",value:function e(){var t=this;var n=function e(n){Object.defineProperty(t,"fieldData",{value:Object.freeze(n),writable:false,enumerable:true,configurable:true})};Promise.all([this.overlayManager.open(this.overlayName),this._dataAvailableCapability.promise]).then(function(){if(t.fieldData){t._updateUI();return}t.pdfDocument.getMetadata().then(function(e){var n=e.info,i=e.metadata;return Promise.all([n,i,t._parseFileSize(t.maybeFileSize),t._parseDate(n.CreationDate),t._parseDate(n.ModDate)])}).then(function(e){var r=i(e,5),s=r[0],o=r[1],u=r[2],l=r[3],c=r[4];n({fileName:(0,a.getPDFFileNameFromURL)(t.url),fileSize:u,title:s.Title,author:s.Author,subject:s.Subject,keywords:s.Keywords,creationDate:l,modificationDate:c,creator:s.Creator,producer:s.Producer,version:s.PDFFormatVersion,pageCount:t.pdfDocument.numPages});t._updateUI();return t.pdfDocument.getDownloadInfo()}).then(function(e){var n=e.length;return t._parseFileSize(n)}).then(function(e){var i=(0,a.cloneObj)(t.fieldData);i["fileSize"]=e;n(i);t._updateUI()})})}},{key:"close",value:function e(){this.overlayManager.close(this.overlayName)}},{key:"setDocument",value:function e(t,n){if(this.pdfDocument){this._reset();this._updateUI(true)}if(!t){return}this.pdfDocument=t;this.url=n;this._dataAvailableCapability.resolve()}},{key:"setFileSize",value:function e(t){if(typeof t==="number"&&t>0){this.maybeFileSize=t}}},{key:"_reset",value:function e(){this.pdfDocument=null;this.url=null;this.maybeFileSize=0;delete this.fieldData;this._dataAvailableCapability=(0,s.createPromiseCapability)()}},{key:"_updateUI",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(t||!this.fieldData){for(var n in this.fields){this.fields[n].textContent=u}return}if(this.overlayManager.active!==this.overlayName){return}for(var i in this.fields){var r=this.fieldData[i];this.fields[i].textContent=r||r===0?r:u}}},{key:"_parseFileSize",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var n=t/1024;if(!n){return Promise.resolve(undefined)}else if(n<1024){return this.l10n.get("document_properties_kb",{size_kb:(+n.toPrecision(3)).toLocaleString(),size_b:t.toLocaleString()},"{{size_kb}} KB ({{size_b}} bytes)")}return this.l10n.get("document_properties_mb",{size_mb:(+(n/1024).toPrecision(3)).toLocaleString(),size_b:t.toLocaleString()},"{{size_mb}} MB ({{size_b}} bytes)")}},{key:"_parseDate",value:function e(t){if(!t){return}var n=t;if(n.substring(0,2)==="D:"){n=n.substring(2)}var i=parseInt(n.substring(0,4),10);var r=parseInt(n.substring(4,6),10)-1;var a=parseInt(n.substring(6,8),10);var s=parseInt(n.substring(8,10),10);var o=parseInt(n.substring(10,12),10);var u=parseInt(n.substring(12,14),10);var l=n.substring(14,15);var c=parseInt(n.substring(15,17),10);var d=parseInt(n.substring(18,20),10);if(l==="-"){s+=c;o+=d}else if(l==="+"){s-=c;o-=d}var h=new Date(Date.UTC(i,r,a,s,o,u));var f=h.toLocaleDateString();var v=h.toLocaleTimeString();return this.l10n.get("document_properties_date_string",{date:f,time:v},"{{date}}, {{time}}")}}]);return e}();t.PDFDocumentProperties=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFFindBar=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(7);var a=n(0);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function e(t){var n=this;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:a.NullL10n;s(this,e);this.opened=false;this.bar=t.bar||null;this.toggleButton=t.toggleButton||null;this.findField=t.findField||null;this.highlightAll=t.highlightAllCheckbox||null;this.caseSensitive=t.caseSensitiveCheckbox||null;this.findMsg=t.findMsg||null;this.findResultsCount=t.findResultsCount||null;this.findStatusIcon=t.findStatusIcon||null;this.findPreviousButton=t.findPreviousButton||null;this.findNextButton=t.findNextButton||null;this.findController=t.findController||null;this.eventBus=t.eventBus;this.l10n=i;if(this.findController===null){throw new Error("PDFFindBar cannot be used without a "+"PDFFindController instance.")}this.toggleButton.addEventListener("click",function(){n.toggle()});this.findField.addEventListener("input",function(){n.dispatchEvent("")});this.bar.addEventListener("keydown",function(e){switch(e.keyCode){case 13:if(e.target===n.findField){n.dispatchEvent("again",e.shiftKey)}break;case 27:n.close();break}});this.findPreviousButton.addEventListener("click",function(){n.dispatchEvent("again",true)});this.findNextButton.addEventListener("click",function(){n.dispatchEvent("again",false)});this.highlightAll.addEventListener("click",function(){n.dispatchEvent("highlightallchange")});this.caseSensitive.addEventListener("click",function(){n.dispatchEvent("casesensitivitychange")});this.eventBus.on("resize",this._adjustWidth.bind(this))}i(e,[{key:"reset",value:function e(){this.updateUIState()}},{key:"dispatchEvent",value:function e(t,n){this.eventBus.dispatch("find",{source:this,type:t,query:this.findField.value,caseSensitive:this.caseSensitive.checked,phraseSearch:true,highlightAll:this.highlightAll.checked,findPrevious:n})}},{key:"updateUIState",value:function e(t,n,i){var a=this;var s=false;var o="";var u="";switch(t){case r.FindState.FOUND:break;case r.FindState.PENDING:u="pending";break;case r.FindState.NOT_FOUND:o=this.l10n.get("find_not_found",null,"Phrase not found");s=true;break;case r.FindState.WRAPPED:if(n){o=this.l10n.get("find_reached_top",null,"Reached top of document, continued from bottom")}else{o=this.l10n.get("find_reached_bottom",null,"Reached end of document, continued from top")}break}if(s){this.findField.classList.add("notFound")}else{this.findField.classList.remove("notFound")}this.findField.setAttribute("data-status",u);Promise.resolve(o).then(function(e){a.findMsg.textContent=e;a._adjustWidth()});this.updateResultsCount(i)}},{key:"updateResultsCount",value:function e(t){if(!this.findResultsCount){return}if(!t){this.findResultsCount.classList.add("hidden");this.findResultsCount.textContent=""}else{this.findResultsCount.textContent=t.toLocaleString();this.findResultsCount.classList.remove("hidden")}this._adjustWidth()}},{key:"open",value:function e(){if(!this.opened){this.opened=true;this.toggleButton.classList.add("toggled");this.bar.classList.remove("hidden")}this.findField.select();this.findField.focus();this._adjustWidth()}},{key:"close",value:function e(){if(!this.opened){return}this.opened=false;this.toggleButton.classList.remove("toggled");this.bar.classList.add("hidden");this.findController.active=false}},{key:"toggle",value:function e(){if(this.opened){this.close()}else{this.open()}}},{key:"_adjustWidth",value:function e(){if(!this.opened){return}this.bar.classList.remove("wrapContainers");var t=this.bar.clientHeight;var n=this.bar.firstElementChild.clientHeight;if(t>n){this.bar.classList.add("wrapContainers")}}}]);return e}();t.PDFFindBar=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isDestsEqual=t.PDFHistory=undefined;var i=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var a=n(0);var s=n(2);function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=1e3;var l=50;var c=2e3;function d(){return document.location.hash}function h(e){var t=unescape(d()).substring(1);var n=(0,a.parseQueryString)(t);var i=n.page|0;if(!(Number.isInteger(i)&&i>0&&i<=e.pagesCount)){i=null}return{hash:t,page:i}}var f=function(){function e(t){var n=this;var i=t.linkService,r=t.eventBus;o(this,e);this.linkService=i;this.eventBus=r||(0,s.getGlobalEventBus)();this.initialized=false;this.initialBookmark=null;this._boundEvents=Object.create(null);this._isViewerInPresentationMode=false;this._isPagesLoaded=false;this.eventBus.on("presentationmodechanged",function(e){n._isViewerInPresentationMode=e.active||e.switchInProgress});this.eventBus.on("pagesloaded",function(e){n._isPagesLoaded=!!e.pagesCount})}r(e,[{key:"initialize",value:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!t||typeof t!=="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}var i=this.initialized&&this.fingerprint!==t;this.fingerprint=t;if(!this.initialized){this._bindEvents()}var r=window.history.state;this.initialized=true;this.initialBookmark=null;this._popStateInProgress=false;this._blockHashChange=0;this._currentHash=d();this._numPositionUpdates=0;this._currentUid=this._uid=0;this._destination=null;this._position=null;if(!this._isValidState(r)||n){var a=h(this.linkService),s=a.hash,o=a.page;if(!s||i||n){this._pushOrReplaceState(null,true);return}this._pushOrReplaceState({hash:s,page:o},true);return}var u=r.destination;this._updateInternalState(u,r.uid,true);if(u.dest){this.initialBookmark=JSON.stringify(u.dest);this._destination.page=null}else if(u.hash){this.initialBookmark=u.hash}else if(u.page){this.initialBookmark="page="+u.page}}},{key:"push",value:function e(t){var n=t.namedDest,i=t.explicitDest,r=t.pageNumber;if(!this.initialized){return}if(n&&typeof n!=="string"||!(i instanceof Array)||!(Number.isInteger(r)&&r>0&&r<=this.linkService.pagesCount)){console.error("PDFHistory.push: Invalid parameters.");return}var a=n||JSON.stringify(i);if(!a){return}var s=false;if(this._destination&&(this._destination.hash===a||v(this._destination.dest,i))){if(this._destination.page){return}s=true}if(this._popStateInProgress&&!s){return}this._pushOrReplaceState({dest:i,hash:a,page:r},s)}},{key:"pushCurrentPosition",value:function e(){if(!this.initialized||this._popStateInProgress){return}this._tryPushCurrentPosition()}},{key:"back",value:function e(){if(!this.initialized||this._popStateInProgress){return}var t=window.history.state;if(this._isValidState(t)&&t.uid>0){window.history.back()}}},{key:"forward",value:function e(){if(!this.initialized||this._popStateInProgress){return}var t=window.history.state;if(this._isValidState(t)&&t.uid<this._uid-1){window.history.forward()}}},{key:"_pushOrReplaceState",value:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i=n||!this._destination;var r={fingerprint:this.fingerprint,uid:i?this._currentUid:this._uid,destination:t};this._updateInternalState(t,r.uid);if(i){window.history.replaceState(r,"",document.URL)}else{window.history.pushState(r,"",document.URL)}}},{key:"_tryPushCurrentPosition",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(!this._position){return}var n=this._position;if(t){n=(0,a.cloneObj)(this._position);n.temporary=true}if(!this._destination){this._pushOrReplaceState(n);return}if(this._destination.temporary){this._pushOrReplaceState(n,true);return}if(this._destination.hash===n.hash){return}if(!this._destination.page&&(l<=0||this._numPositionUpdates<=l)){return}var i=false;if(this._destination.page===n.first||this._destination.page===n.page){if(this._destination.dest||!this._destination.first){return}i=true}this._pushOrReplaceState(n,i)}},{key:"_isValidState",value:function e(t){if(!t){return false}if(t.fingerprint!==this.fingerprint){return false}if(!Number.isInteger(t.uid)||t.uid<0){return false}if(t.destination===null||i(t.destination)!=="object"){return false}return true}},{key:"_updateInternalState",value:function e(t,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(i&&t&&t.temporary){delete t.temporary}this._destination=t;this._currentUid=n;this._uid=this._currentUid+1;this._numPositionUpdates=0}},{key:"_updateViewarea",value:function e(t){var n=this;var i=t.location;if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}this._position={hash:this._isViewerInPresentationMode?"page="+i.pageNumber:i.pdfOpenParams.substring(1),page:this.linkService.page,first:i.pageNumber};if(this._popStateInProgress){return}if(l>0&&this._isPagesLoaded&&this._destination&&!this._destination.page){this._numPositionUpdates++}if(c>0){this._updateViewareaTimeout=setTimeout(function(){if(!n._popStateInProgress){n._tryPushCurrentPosition(true)}n._updateViewareaTimeout=null},c)}}},{key:"_popState",value:function e(t){var n=this;var i=t.state;var r=d(),s=this._currentHash!==r;this._currentHash=r;if(!i||false){this._currentUid=this._uid;var o=h(this.linkService),l=o.hash,c=o.page;this._pushOrReplaceState({hash:l,page:c},true);return}if(!this._isValidState(i)){return}this._popStateInProgress=true;if(s){this._blockHashChange++;(0,a.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:u}).then(function(){n._blockHashChange--})}if(i.uid<this._currentUid&&this._position&&this._destination){var f=false;if(this._destination.temporary){this._pushOrReplaceState(this._position);f=true}else if(this._destination.page&&this._destination.page!==this._position.first&&this._destination.page!==this._position.page){this._pushOrReplaceState(this._destination);this._pushOrReplaceState(this._position);f=true}if(f){this._currentUid=i.uid;window.history.back();return}}var v=i.destination;this._updateInternalState(v,i.uid,true);if(v.dest){this.linkService.navigateTo(v.dest)}else if(v.hash){this.linkService.setHash(v.hash)}else if(v.page){this.linkService.page=v.page}Promise.resolve().then(function(){n._popStateInProgress=false})}},{key:"_bindEvents",value:function e(){var t=this;var n=this._boundEvents,i=this.eventBus;n.updateViewarea=this._updateViewarea.bind(this);n.popState=this._popState.bind(this);n.pageHide=function(e){if(!t._destination){t._tryPushCurrentPosition()}};i.on("updateviewarea",n.updateViewarea);window.addEventListener("popstate",n.popState);window.addEventListener("pagehide",n.pageHide)}},{key:"popStateInProgress",get:function e(){return this.initialized&&(this._popStateInProgress||this._blockHashChange>0)}}]);return e}();function v(e,t){function n(e,t){if((typeof e==="undefined"?"undefined":i(e))!==(typeof t==="undefined"?"undefined":i(t))){return false}if(e instanceof Array||t instanceof Array){return false}if(e!==null&&(typeof e==="undefined"?"undefined":i(e))==="object"&&t!==null){if(Object.keys(e).length!==Object.keys(t).length){return false}for(var r in e){if(!n(e[r],t[r])){return false}}return true}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!(e instanceof Array&&t instanceof Array)){return false}if(e.length!==t.length){return false}for(var r=0,a=e.length;r<a;r++){if(!n(e[r],t[r])){return false}}return true}t.PDFHistory=f;t.isDestsEqual=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFOutlineViewer=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(1);function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s="\u2013";var o=function(){function e(t){var n=t.container,i=t.linkService,r=t.eventBus;a(this,e);this.container=n;this.linkService=i;this.eventBus=r;this.reset()}i(e,[{key:"reset",value:function e(){this.outline=null;this.lastToggleIsShow=true;this.container.textContent="";this.container.classList.remove("outlineWithDeepNesting")}},{key:"_dispatchEvent",value:function e(t){this.eventBus.dispatch("outlineloaded",{source:this,outlineCount:t})}},{key:"_bindLink",value:function e(t,n){var i=this;if(n.url){(0,r.addLinkAttributes)(t,{url:n.url,target:n.newWindow?r.PDFJS.LinkTarget.BLANK:undefined});return}var a=n.dest;t.href=this.linkService.getDestinationHash(a);t.onclick=function(){if(a){i.linkService.navigateTo(a)}return false}}},{key:"_setStyles",value:function e(t,n){var i="";if(n.bold){i+="font-weight: bold;"}if(n.italic){i+="font-style: italic;"}if(i){t.setAttribute("style",i)}}},{key:"_addToggleButton",value:function e(t){var n=this;var i=document.createElement("div");i.className="outlineItemToggler";i.onclick=function(e){e.stopPropagation();i.classList.toggle("outlineItemsHidden");if(e.shiftKey){var r=!i.classList.contains("outlineItemsHidden");n._toggleOutlineItem(t,r)}};t.insertBefore(i,t.firstChild)}},{key:"_toggleOutlineItem",value:function e(t,n){this.lastToggleIsShow=n;var i=t.querySelectorAll(".outlineItemToggler");for(var r=0,a=i.length;r<a;++r){i[r].classList[n?"remove":"add"]("outlineItemsHidden")}}},{key:"toggleOutlineTree",value:function e(){if(!this.outline){return}this._toggleOutlineItem(this.container,!this.lastToggleIsShow)}},{key:"render",value:function e(t){var n=t.outline;var i=0;if(this.outline){this.reset()}this.outline=n||null;if(!n){this._dispatchEvent(i);return}var a=document.createDocumentFragment();var o=[{parent:a,items:this.outline}];var u=false;while(o.length>0){var l=o.shift();for(var c=0,d=l.items.length;c<d;c++){var h=l.items[c];var f=document.createElement("div");f.className="outlineItem";var v=document.createElement("a");this._bindLink(v,h);this._setStyles(v,h);v.textContent=(0,r.removeNullCharacters)(h.title)||s;f.appendChild(v);if(h.items.length>0){u=true;this._addToggleButton(f);var g=document.createElement("div");g.className="outlineItems";f.appendChild(g);o.push({parent:g,items:h.items})}l.parent.appendChild(f);i++}}if(u){this.container.classList.add("outlineWithDeepNesting")}this.container.appendChild(a);this._dispatchEvent(i)}}]);return e}();t.PDFOutlineViewer=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFPresentationMode=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(0);function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=1500;var o=3e3;var u="pdfPresentationMode";var l="pdfPresentationModeControls";var c=50;var d=.1;var h=50;var f=Math.PI/6;var v=function(){function e(t){var n=this;var i=t.container,r=t.viewer,s=r===undefined?null:r,o=t.pdfViewer,u=t.eventBus,l=t.contextMenuItems,c=l===undefined?null:l;a(this,e);this.container=i;this.viewer=s||i.firstElementChild;this.pdfViewer=o;this.eventBus=u;this.active=false;this.args=null;this.contextMenuOpen=false;this.mouseScrollTimeStamp=0;this.mouseScrollDelta=0;this.touchSwipeState=null;if(c){c.contextFirstPage.addEventListener("click",function(){n.contextMenuOpen=false;n.eventBus.dispatch("firstpage")});c.contextLastPage.addEventListener("click",function(){n.contextMenuOpen=false;n.eventBus.dispatch("lastpage")});c.contextPageRotateCw.addEventListener("click",function(){n.contextMenuOpen=false;n.eventBus.dispatch("rotatecw")});c.contextPageRotateCcw.addEventListener("click",function(){n.contextMenuOpen=false;n.eventBus.dispatch("rotateccw")})}}i(e,[{key:"request",value:function e(){if(this.switchInProgress||this.active||!this.viewer.hasChildNodes()){return false}this._addFullscreenChangeListeners();this._setSwitchInProgress();this._notifyStateChange();if(this.container.requestFullscreen){this.container.requestFullscreen()}else if(this.container.mozRequestFullScreen){this.container.mozRequestFullScreen()}else if(this.container.webkitRequestFullscreen){this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}else if(this.container.msRequestFullscreen){this.container.msRequestFullscreen()}else{return false}this.args={page:this.pdfViewer.currentPageNumber,previousScale:this.pdfViewer.currentScaleValue};return true}},{key:"_mouseWheel",value:function e(t){if(!this.active){return}t.preventDefault();var n=(0,r.normalizeWheelEventDelta)(t);var i=(new Date).getTime();var a=this.mouseScrollTimeStamp;if(i>a&&i-a<c){return}if(this.mouseScrollDelta>0&&n<0||this.mouseScrollDelta<0&&n>0){this._resetMouseScrollState()}this.mouseScrollDelta+=n;if(Math.abs(this.mouseScrollDelta)>=d){var s=this.mouseScrollDelta;this._resetMouseScrollState();var o=s>0?this._goToPreviousPage():this._goToNextPage();if(o){this.mouseScrollTimeStamp=i}}}},{key:"_goToPreviousPage",value:function e(){var t=this.pdfViewer.currentPageNumber;if(t<=1){return false}this.pdfViewer.currentPageNumber=t-1;return true}},{key:"_goToNextPage",value:function e(){var t=this.pdfViewer.currentPageNumber;if(t>=this.pdfViewer.pagesCount){return false}this.pdfViewer.currentPageNumber=t+1;return true}},{key:"_notifyStateChange",value:function e(){this.eventBus.dispatch("presentationmodechanged",{source:this,active:this.active,switchInProgress:!!this.switchInProgress})}},{key:"_setSwitchInProgress",value:function e(){var t=this;if(this.switchInProgress){clearTimeout(this.switchInProgress)}this.switchInProgress=setTimeout(function(){t._removeFullscreenChangeListeners();delete t.switchInProgress;t._notifyStateChange()},s)}},{key:"_resetSwitchInProgress",value:function e(){if(this.switchInProgress){clearTimeout(this.switchInProgress);delete this.switchInProgress}}},{key:"_enter",value:function e(){var t=this;this.active=true;this._resetSwitchInProgress();this._notifyStateChange();this.container.classList.add(u);setTimeout(function(){t.pdfViewer.currentPageNumber=t.args.page;t.pdfViewer.currentScaleValue="page-fit"},0);this._addWindowListeners();this._showControls();this.contextMenuOpen=false;this.container.setAttribute("contextmenu","viewerContextMenu");window.getSelection().removeAllRanges()}},{key:"_exit",value:function e(){var t=this;var n=this.pdfViewer.currentPageNumber;this.container.classList.remove(u);setTimeout(function(){t.active=false;t._removeFullscreenChangeListeners();t._notifyStateChange();t.pdfViewer.currentScaleValue=t.args.previousScale;t.pdfViewer.currentPageNumber=n;t.args=null},0);this._removeWindowListeners();this._hideControls();this._resetMouseScrollState();this.container.removeAttribute("contextmenu");this.contextMenuOpen=false}},{key:"_mouseDown",value:function e(t){if(this.contextMenuOpen){this.contextMenuOpen=false;t.preventDefault();return}if(t.button===0){var n=t.target.href&&t.target.classList.contains("internalLink");if(!n){t.preventDefault();if(t.shiftKey){this._goToPreviousPage()}else{this._goToNextPage()}}}}},{key:"_contextMenu",value:function e(){this.contextMenuOpen=true}},{key:"_showControls",value:function e(){var t=this;if(this.controlsTimeout){clearTimeout(this.controlsTimeout)}else{this.container.classList.add(l)}this.controlsTimeout=setTimeout(function(){t.container.classList.remove(l);delete t.controlsTimeout},o)}},{key:"_hideControls",value:function e(){if(!this.controlsTimeout){return}clearTimeout(this.controlsTimeout);this.container.classList.remove(l);delete this.controlsTimeout}},{key:"_resetMouseScrollState",value:function e(){this.mouseScrollTimeStamp=0;this.mouseScrollDelta=0}},{key:"_touchSwipe",value:function e(t){if(!this.active){return}if(t.touches.length>1){this.touchSwipeState=null;return}switch(t.type){case"touchstart":this.touchSwipeState={startX:t.touches[0].pageX,startY:t.touches[0].pageY,endX:t.touches[0].pageX,endY:t.touches[0].pageY};break;case"touchmove":if(this.touchSwipeState===null){return}this.touchSwipeState.endX=t.touches[0].pageX;this.touchSwipeState.endY=t.touches[0].pageY;t.preventDefault();break;case"touchend":if(this.touchSwipeState===null){return}var n=0;var i=this.touchSwipeState.endX-this.touchSwipeState.startX;var r=this.touchSwipeState.endY-this.touchSwipeState.startY;var a=Math.abs(Math.atan2(r,i));if(Math.abs(i)>h&&(a<=f||a>=Math.PI-f)){n=i}else if(Math.abs(r)>h&&Math.abs(a-Math.PI/2)<=f){n=r}if(n>0){this._goToPreviousPage()}else if(n<0){this._goToNextPage()}break}}},{key:"_addWindowListeners",value:function e(){this.showControlsBind=this._showControls.bind(this);this.mouseDownBind=this._mouseDown.bind(this);this.mouseWheelBind=this._mouseWheel.bind(this);this.resetMouseScrollStateBind=this._resetMouseScrollState.bind(this);this.contextMenuBind=this._contextMenu.bind(this);this.touchSwipeBind=this._touchSwipe.bind(this);window.addEventListener("mousemove",this.showControlsBind);window.addEventListener("mousedown",this.mouseDownBind);window.addEventListener("wheel",this.mouseWheelBind);window.addEventListener("keydown",this.resetMouseScrollStateBind);window.addEventListener("contextmenu",this.contextMenuBind);window.addEventListener("touchstart",this.touchSwipeBind);window.addEventListener("touchmove",this.touchSwipeBind);window.addEventListener("touchend",this.touchSwipeBind)}},{key:"_removeWindowListeners",value:function e(){window.removeEventListener("mousemove",this.showControlsBind);window.removeEventListener("mousedown",this.mouseDownBind);window.removeEventListener("wheel",this.mouseWheelBind);window.removeEventListener("keydown",this.resetMouseScrollStateBind);window.removeEventListener("contextmenu",this.contextMenuBind);window.removeEventListener("touchstart",this.touchSwipeBind);window.removeEventListener("touchmove",this.touchSwipeBind);window.removeEventListener("touchend",this.touchSwipeBind);delete this.showControlsBind;delete this.mouseDownBind;delete this.mouseWheelBind;delete this.resetMouseScrollStateBind;delete this.contextMenuBind;delete this.touchSwipeBind}},{key:"_fullscreenChange",value:function e(){if(this.isFullscreen){this._enter()}else{this._exit()}}},{key:"_addFullscreenChangeListeners",value:function e(){this.fullscreenChangeBind=this._fullscreenChange.bind(this);window.addEventListener("fullscreenchange",this.fullscreenChangeBind);window.addEventListener("mozfullscreenchange",this.fullscreenChangeBind);window.addEventListener("webkitfullscreenchange",this.fullscreenChangeBind);window.addEventListener("MSFullscreenChange",this.fullscreenChangeBind)}},{key:"_removeFullscreenChangeListeners",value:function e(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind);window.removeEventListener("mozfullscreenchange",this.fullscreenChangeBind);window.removeEventListener("webkitfullscreenchange",this.fullscreenChangeBind);window.removeEventListener("MSFullscreenChange",this.fullscreenChangeBind);delete this.fullscreenChangeBind}},{key:"isFullscreen",get:function e(){return!!(document.fullscreenElement||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement)}}]);return e}();t.PDFPresentationMode=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFThumbnailViewer=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(0);var a=n(24);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o=-19;var u=function(){function e(t){var n=t.container,i=t.linkService,a=t.renderingQueue,o=t.l10n,u=o===undefined?r.NullL10n:o;s(this,e);this.container=n;this.linkService=i;this.renderingQueue=a;this.l10n=u;this.scroll=(0,r.watchScroll)(this.container,this._scrollUpdated.bind(this));this._resetView()}i(e,[{key:"_scrollUpdated",value:function e(){this.renderingQueue.renderHighestPriority()}},{key:"getThumbnail",value:function e(t){return this._thumbnails[t]}},{key:"_getVisibleThumbs",value:function e(){return(0,r.getVisibleElements)(this.container,this._thumbnails)}},{key:"scrollThumbnailIntoView",value:function e(t){var n=document.querySelector(".thumbnail.selected");if(n){n.classList.remove("selected")}var i=document.querySelector('div.thumbnail[data-page-number="'+t+'"]');if(i){i.classList.add("selected")}var a=this._getVisibleThumbs();var s=a.views.length;if(s>0){var u=a.first.id;var l=s>1?a.last.id:u;if(t<=u||t>=l){(0,r.scrollIntoView)(i,{top:o})}}}},{key:"cleanup",value:function e(){a.PDFThumbnailView.cleanup()}},{key:"_resetView",value:function e(){this._thumbnails=[];this._pageLabels=null;this._pagesRotation=0;this._pagesRequests=[];this.container.textContent=""}},{key:"setDocument",value:function e(t){var n=this;if(this.pdfDocument){this._cancelRendering();this._resetView()}this.pdfDocument=t;if(!t){return}t.getPage(1).then(function(e){var i=t.numPages;var r=e.getViewport(1);for(var s=1;s<=i;++s){var o=new a.PDFThumbnailView({container:n.container,id:s,defaultViewport:r.clone(),linkService:n.linkService,renderingQueue:n.renderingQueue,disableCanvasToImageConversion:false,l10n:n.l10n});n._thumbnails.push(o)}}).catch(function(e){console.error("Unable to initialize thumbnail viewer",e)})}},{key:"_cancelRendering",value:function e(){for(var t=0,n=this._thumbnails.length;t<n;t++){if(this._thumbnails[t]){this._thumbnails[t].cancelRendering()}}}},{key:"setPageLabels",value:function e(t){if(!this.pdfDocument){return}if(!t){this._pageLabels=null}else if(!(t instanceof Array&&this.pdfDocument.numPages===t.length)){this._pageLabels=null;console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")}else{this._pageLabels=t}for(var n=0,i=this._thumbnails.length;n<i;n++){var r=this._pageLabels&&this._pageLabels[n];this._thumbnails[n].setPageLabel(r)}}},{key:"_ensurePdfPageLoaded",value:function e(t){var n=this;if(t.pdfPage){return Promise.resolve(t.pdfPage)}var i=t.id;if(this._pagesRequests[i]){return this._pagesRequests[i]}var r=this.pdfDocument.getPage(i).then(function(e){t.setPdfPage(e);n._pagesRequests[i]=null;return e}).catch(function(e){console.error("Unable to get page for thumb view",e);n._pagesRequests[i]=null});this._pagesRequests[i]=r;return r}},{key:"forceRendering",value:function e(){var t=this;var n=this._getVisibleThumbs();var i=this.renderingQueue.getHighestPriority(n,this._thumbnails,this.scroll.down);if(i){this._ensurePdfPageLoaded(i).then(function(){t.renderingQueue.renderView(i)});return true}return false}},{key:"pagesRotation",get:function e(){return this._pagesRotation},set:function e(t){if(!(typeof t==="number"&&t%90===0)){throw new Error("Invalid thumbnails rotation angle.")}if(!this.pdfDocument){return}this._pagesRotation=t;for(var n=0,i=this._thumbnails.length;n<i;n++){this._thumbnails[n].update(t)}}}]);return e}();t.PDFThumbnailViewer=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFThumbnailView=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(1);var a=n(0);var s=n(3);function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=3;var l=1;var c=98;var d=function e(){var t=null;return{getCanvas:function e(n,i){var r=t;if(!r){r=document.createElement("canvas");t=r}r.width=n;r.height=i;r.mozOpaque=true;var a=r.getContext("2d",{alpha:false});a.save();a.fillStyle="rgb(255, 255, 255)";a.fillRect(0,0,n,i);a.restore();return r},destroyCanvas:function e(){var n=t;if(n){n.width=0;n.height=0}t=null}}}();var h=function(){function e(t){var n=t.container,i=t.id,r=t.defaultViewport,u=t.linkService,d=t.renderingQueue,h=t.disableCanvasToImageConversion,f=h===undefined?false:h,v=t.l10n,g=v===undefined?a.NullL10n:v;o(this,e);this.id=i;this.renderingId="thumbnail"+i;this.pageLabel=null;this.pdfPage=null;this.rotation=0;this.viewport=r;this.pdfPageRotate=r.rotation;this.linkService=u;this.renderingQueue=d;this.renderTask=null;this.renderingState=s.RenderingStates.INITIAL;this.resume=null;this.disableCanvasToImageConversion=f;this.pageWidth=this.viewport.width;this.pageHeight=this.viewport.height;this.pageRatio=this.pageWidth/this.pageHeight;this.canvasWidth=c;this.canvasHeight=this.canvasWidth/this.pageRatio|0;this.scale=this.canvasWidth/this.pageWidth;this.l10n=g;var p=document.createElement("a");p.href=u.getAnchorUrl("#page="+i);this.l10n.get("thumb_page_title",{page:i},"Page {{page}}").then(function(e){p.title=e});p.onclick=function(){u.page=i;return false};this.anchor=p;var m=document.createElement("div");m.className="thumbnail";m.setAttribute("data-page-number",this.id);this.div=m;if(i===1){m.classList.add("selected")}var w=document.createElement("div");w.className="thumbnailSelectionRing";var b=2*l;w.style.width=this.canvasWidth+b+"px";w.style.height=this.canvasHeight+b+"px";this.ring=w;m.appendChild(w);p.appendChild(m);n.appendChild(p)}i(e,[{key:"setPdfPage",value:function e(t){this.pdfPage=t;this.pdfPageRotate=t.rotate;var n=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport(1,n);this.reset()}},{key:"reset",value:function e(){this.cancelRendering();this.pageWidth=this.viewport.width;this.pageHeight=this.viewport.height;this.pageRatio=this.pageWidth/this.pageHeight;this.canvasHeight=this.canvasWidth/this.pageRatio|0;this.scale=this.canvasWidth/this.pageWidth;this.div.removeAttribute("data-loaded");var t=this.ring;var n=t.childNodes;for(var i=n.length-1;i>=0;i--){t.removeChild(n[i])}var r=2*l;t.style.width=this.canvasWidth+r+"px";t.style.height=this.canvasHeight+r+"px";if(this.canvas){this.canvas.width=0;this.canvas.height=0;delete this.canvas}if(this.image){this.image.removeAttribute("src");delete this.image}}},{key:"update",value:function e(t){if(typeof t!=="undefined"){this.rotation=t}var n=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:n});this.reset()}},{key:"cancelRendering",value:function e(){if(this.renderTask){this.renderTask.cancel();this.renderTask=null}this.renderingState=s.RenderingStates.INITIAL;this.resume=null}},{key:"_getPageDrawContext",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var n=document.createElement("canvas");this.canvas=n;n.mozOpaque=true;var i=n.getContext("2d",{alpha:false});var r=(0,a.getOutputScale)(i);n.width=this.canvasWidth*r.sx|0;n.height=this.canvasHeight*r.sy|0;n.style.width=this.canvasWidth+"px";n.style.height=this.canvasHeight+"px";if(!t&&r.scaled){i.scale(r.sx,r.sy)}return i}},{key:"_convertCanvasToImage",value:function e(){var t=this;if(!this.canvas){return}if(this.renderingState!==s.RenderingStates.FINISHED){return}var n=this.renderingId;var i="thumbnailImage";if(this.disableCanvasToImageConversion){this.canvas.id=n;this.canvas.className=i;this.l10n.get("thumb_page_canvas",{page:this.pageId},"Thumbnail of Page {{page}}").then(function(e){t.canvas.setAttribute("aria-label",e)});this.div.setAttribute("data-loaded",true);this.ring.appendChild(this.canvas);return}var r=document.createElement("img");r.id=n;r.className=i;this.l10n.get("thumb_page_canvas",{page:this.pageId},"Thumbnail of Page {{page}}").then(function(e){r.setAttribute("aria-label",e)});r.style.width=this.canvasWidth+"px";r.style.height=this.canvasHeight+"px";r.src=this.canvas.toDataURL();this.image=r;this.div.setAttribute("data-loaded",true);this.ring.appendChild(r);this.canvas.width=0;this.canvas.height=0;delete this.canvas}},{key:"draw",value:function e(){var t=this;if(this.renderingState!==s.RenderingStates.INITIAL){console.error("Must be in new state before drawing");return Promise.resolve(undefined)}this.renderingState=s.RenderingStates.RUNNING;var n=(0,r.createPromiseCapability)();var i=function e(i){if(c===t.renderTask){t.renderTask=null}if(i==="cancelled"||i instanceof r.RenderingCancelledException){n.resolve(undefined);return}t.renderingState=s.RenderingStates.FINISHED;t._convertCanvasToImage();if(!i){n.resolve(undefined)}else{n.reject(i)}};var a=this._getPageDrawContext();var o=this.viewport.clone({scale:this.scale});var u=function e(n){if(!t.renderingQueue.isHighestPriority(t)){t.renderingState=s.RenderingStates.PAUSED;t.resume=function(){t.renderingState=s.RenderingStates.RUNNING;n()};return}n()};var l={canvasContext:a,viewport:o};var c=this.renderTask=this.pdfPage.render(l);c.onContinue=u;c.promise.then(function(){i(null)},function(e){i(e)});return n.promise}},{key:"setImage",value:function e(t){if(this.renderingState!==s.RenderingStates.INITIAL){return}var n=t.canvas;if(!n){return}if(!this.pdfPage){this.setPdfPage(t.pdfPage)}this.renderingState=s.RenderingStates.FINISHED;var i=this._getPageDrawContext(true);var r=i.canvas;if(n.width<=2*r.width){i.drawImage(n,0,0,n.width,n.height,0,0,r.width,r.height);this._convertCanvasToImage();return}var a=r.width<<u;var o=r.height<<u;var l=d.getCanvas(a,o);var c=l.getContext("2d");while(a>n.width||o>n.height){a>>=1;o>>=1}c.drawImage(n,0,0,n.width,n.height,0,0,a,o);while(a>2*r.width){c.drawImage(l,0,0,a,o,0,0,a>>1,o>>1);a>>=1;o>>=1}i.drawImage(l,0,0,a,o,0,0,r.width,r.height);this._convertCanvasToImage()}},{key:"setPageLabel",value:function e(t){var n=this;this.pageLabel=typeof t==="string"?t:null;this.l10n.get("thumb_page_title",{page:this.pageId},"Page {{page}}").then(function(e){n.anchor.title=e});if(this.renderingState!==s.RenderingStates.FINISHED){return}this.l10n.get("thumb_page_canvas",{page:this.pageId},"Thumbnail of Page {{page}}").then(function(e){if(n.image){n.image.setAttribute("aria-label",e)}else if(n.disableCanvasToImageConversion&&n.canvas){n.canvas.setAttribute("aria-label",e)}})}},{key:"pageId",get:function e(){return this.pageLabel!==null?this.pageLabel:this.id}}],[{key:"cleanup",value:function e(){d.destroyCanvas()}}]);return e}();t.PDFThumbnailView=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SecondaryToolbar=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(6);var a=n(0);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function e(t,n,i){s(this,e);this.toolbar=t.toolbar;this.toggleButton=t.toggleButton;this.buttonContainer=t.toolbarButtonContainer;this.buttons=[{element:t.presentationModeButton,eventName:"presentationmode",close:true},{element:t.openFileButton,eventName:"openfile",close:true},{element:t.printButton,eventName:"print",close:true},{element:t.downloadButton,eventName:"download",close:true},{element:t.viewBookmarkButton,eventName:null,close:true},{element:t.firstPageButton,eventName:"firstpage",close:true},{element:t.lastPageButton,eventName:"lastpage",close:true},{element:t.pageRotateCwButton,eventName:"rotatecw",close:false},{element:t.pageRotateCcwButton,eventName:"rotateccw",close:false},{element:t.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:r.CursorTool.SELECT},close:true},{element:t.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:r.CursorTool.HAND},close:true},{element:t.documentPropertiesButton,eventName:"documentproperties",close:true}];this.items={firstPage:t.firstPageButton,lastPage:t.lastPageButton,pageRotateCw:t.pageRotateCwButton,pageRotateCcw:t.pageRotateCcwButton};this.mainContainer=n;this.eventBus=i;this.opened=false;this.containerHeight=null;this.previousContainerHeight=null;this.reset();this._bindClickListeners();this._bindCursorToolsListener(t);this.eventBus.on("resize",this._setMaxHeight.bind(this))}i(e,[{key:"setPageNumber",value:function e(t){this.pageNumber=t;this._updateUIState()}},{key:"setPagesCount",value:function e(t){this.pagesCount=t;this._updateUIState()}},{key:"reset",value:function e(){this.pageNumber=0;this.pagesCount=0;this._updateUIState()}},{key:"_updateUIState",value:function e(){this.items.firstPage.disabled=this.pageNumber<=1;this.items.lastPage.disabled=this.pageNumber>=this.pagesCount;this.items.pageRotateCw.disabled=this.pagesCount===0;this.items.pageRotateCcw.disabled=this.pagesCount===0}},{key:"_bindClickListeners",value:function e(){var t=this;this.toggleButton.addEventListener("click",this.toggle.bind(this));var n=function e(n){var i=t.buttons[n],r=i.element,a=i.eventName,s=i.close,o=i.eventDetails;r.addEventListener("click",function(e){if(a!==null){var n={source:t};for(var i in o){n[i]=o[i]}t.eventBus.dispatch(a,n)}if(s){t.close()}})};for(var i in this.buttons){n(i)}}},{key:"_bindCursorToolsListener",value:function e(t){this.eventBus.on("cursortoolchanged",function(e){t.cursorSelectToolButton.classList.remove("toggled");t.cursorHandToolButton.classList.remove("toggled");switch(e.tool){case r.CursorTool.SELECT:t.cursorSelectToolButton.classList.add("toggled");break;case r.CursorTool.HAND:t.cursorHandToolButton.classList.add("toggled");break}})}},{key:"open",value:function e(){if(this.opened){return}this.opened=true;this._setMaxHeight();this.toggleButton.classList.add("toggled");this.toolbar.classList.remove("hidden")}},{key:"close",value:function e(){if(!this.opened){return}this.opened=false;this.toolbar.classList.add("hidden");this.toggleButton.classList.remove("toggled")}},{key:"toggle",value:function e(){if(this.opened){this.close()}else{this.open()}}},{key:"_setMaxHeight",value:function e(){if(!this.opened){return}this.containerHeight=this.mainContainer.clientHeight;if(this.containerHeight===this.previousContainerHeight){return}this.buttonContainer.setAttribute("style","max-height: "+(this.containerHeight-a.SCROLLBAR_PADDING)+"px;");this.previousContainerHeight=this.containerHeight}},{key:"isOpen",get:function e(){return this.opened}}]);return e}();t.SecondaryToolbar=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Toolbar=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(0);function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s="visiblePageIsLoading";var o=8;var u=22;var l=function(){function e(t,n,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:r.NullL10n;a(this,e);this.toolbar=t.container;this.mainContainer=n;this.eventBus=i;this.l10n=s;this.items=t;this._wasLocalized=false;this.reset();this._bindListeners()}i(e,[{key:"setPageNumber",value:function e(t,n){this.pageNumber=t;this.pageLabel=n;this._updateUIState(false)}},{key:"setPagesCount",value:function e(t,n){this.pagesCount=t;this.hasPageLabels=n;this._updateUIState(true)}},{key:"setPageScale",value:function e(t,n){this.pageScaleValue=t;this.pageScale=n;this._updateUIState(false)}},{key:"reset",value:function e(){this.pageNumber=0;this.pageLabel=null;this.hasPageLabels=false;this.pagesCount=0;this.pageScaleValue=r.DEFAULT_SCALE_VALUE;this.pageScale=r.DEFAULT_SCALE;this._updateUIState(true)}},{key:"_bindListeners",value:function e(){var t=this;var n=this.eventBus,i=this.items;var a=this;i.previous.addEventListener("click",function(){n.dispatch("previouspage")});i.next.addEventListener("click",function(){n.dispatch("nextpage")});i.zoomIn.addEventListener("click",function(){n.dispatch("zoomin")});i.zoomOut.addEventListener("click",function(){n.dispatch("zoomout")});i.pageNumber.addEventListener("click",function(){this.select()});i.pageNumber.addEventListener("change",function(){n.dispatch("pagenumberchanged",{source:a,value:this.value})});i.scaleSelect.addEventListener("change",function(){if(this.value==="custom"){return}n.dispatch("scalechanged",{source:a,value:this.value})});i.presentationModeButton.addEventListener("click",function(){n.dispatch("presentationmode")});i.openFile.addEventListener("click",function(){n.dispatch("openfile")});i.print.addEventListener("click",function(){n.dispatch("print")});i.download.addEventListener("click",function(){n.dispatch("download")});i.scaleSelect.oncontextmenu=r.noContextMenuHandler;n.on("localized",function(){t._localized()})}},{key:"_localized",value:function e(){this._wasLocalized=true;this._adjustScaleWidth();this._updateUIState(true)}},{key:"_updateUIState",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(!this._wasLocalized){return}var n=this.pageNumber,i=this.pagesCount,a=this.items;var s=(this.pageScaleValue||this.pageScale).toString();var o=this.pageScale;if(t){if(this.hasPageLabels){a.pageNumber.type="text"}else{a.pageNumber.type="number";this.l10n.get("of_pages",{pagesCount:i},"of {{pagesCount}}").then(function(e){a.numPages.textContent=e})}a.pageNumber.max=i}if(this.hasPageLabels){a.pageNumber.value=this.pageLabel;this.l10n.get("page_of_pages",{pageNumber:n,pagesCount:i},"({{pageNumber}} of {{pagesCount}})").then(function(e){a.numPages.textContent=e})}else{a.pageNumber.value=n}a.previous.disabled=n<=1;a.next.disabled=n>=i;a.zoomOut.disabled=o<=r.MIN_SCALE;a.zoomIn.disabled=o>=r.MAX_SCALE;var u=Math.round(o*1e4)/100;this.l10n.get("page_scale_percent",{scale:u},"{{scale}}%").then(function(e){var t=a.scaleSelect.options;var n=false;for(var i=0,r=t.length;i<r;i++){var o=t[i];if(o.value!==s){o.selected=false;continue}o.selected=true;n=true}if(!n){a.customScaleOption.textContent=e;a.customScaleOption.selected=true}})}},{key:"updateLoadingIndicatorState",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var n=this.items.pageNumber;if(t){n.classList.add(s)}else{n.classList.remove(s)}}},{key:"_adjustScaleWidth",value:function e(){var t=this.items.scaleSelectContainer;var n=this.items.scaleSelect;r.animationStarted.then(function(){if(t.clientWidth===0){t.setAttribute("style","display: inherit;")}if(t.clientWidth>0){n.setAttribute("style","min-width: inherit;");var e=n.clientWidth+o;n.setAttribute("style","min-width: "+(e+u)+"px;");t.setAttribute("style","min-width: "+e+"px; "+"max-width: "+e+"px;")}})}}]);return e}();t.Toolbar=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var a=20;var s=function(){function e(t){var n=this;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:a;r(this,e);this.fingerprint=t;this.cacheSize=i;this._initializedPromise=this._readFromStorage().then(function(e){var t=JSON.parse(e||"{}");if(!("files"in t)){t.files=[]}if(t.files.length>=n.cacheSize){t.files.shift()}var i=void 0;for(var r=0,a=t.files.length;r<a;r++){var s=t.files[r];if(s.fingerprint===n.fingerprint){i=r;break}}if(typeof i!=="number"){i=t.files.push({fingerprint:n.fingerprint})-1}n.file=t.files[i];n.database=t})}i(e,[{key:"_writeToStorage",value:function e(){var t=this;return new Promise(function(e){var n=JSON.stringify(t.database);localStorage.setItem("pdfjs.history",n);e()})}},{key:"_readFromStorage",value:function e(){return new Promise(function(e){e(localStorage.getItem("pdfjs.history"))})}},{key:"set",value:function e(t,n){var i=this;return this._initializedPromise.then(function(){i.file[t]=n;return i._writeToStorage()})}},{key:"setMultiple",value:function e(t){var n=this;return this._initializedPromise.then(function(){for(var e in t){n.file[e]=t[e]}return n._writeToStorage()})}},{key:"get",value:function e(t,n){var i=this;return this._initializedPromise.then(function(){var e=i.file[t];return e!==undefined?e:n})}},{key:"getMultiple",value:function e(t){var n=this;return this._initializedPromise.then(function(){var e=Object.create(null);for(var i in t){var r=n.file[i];e[i]=r!==undefined?r:t[i]}return e})}}]);return e}();t.ViewHistory=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GenericCom=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(4);var a=n(29);var s=n(30);var o=n(31);var u=n(1);function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function d(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var h={};var f=function(e){d(t,e);function t(){l(this,t);return c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}i(t,[{key:"_writeToStorage",value:function e(t){return new Promise(function(e){localStorage.setItem("pdfjs.preferences",JSON.stringify(t));e()})}},{key:"_readFromStorage",value:function e(t){return new Promise(function(e){var t=JSON.parse(localStorage.getItem("pdfjs.preferences"));e(t)})}}]);return t}(a.BasePreferences);var v=Object.create(r.DefaultExternalServices);v.createDownloadManager=function(){return new s.DownloadManager};v.createPreferences=function(){return new f};v.createL10n=function(){return new o.GenericL10n(u.PDFJS.locale)};r.PDFViewerApplication.externalServices=v;t.GenericCom=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BasePreferences=undefined;var i=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var a=n(0);function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var o=null;function u(){if(!o){o=Promise.resolve({showPreviousViewOnLoad:true,defaultZoomValue:"",sidebarViewOnLoad:0,enableHandToolOnLoad:false,cursorToolOnLoad:0,enableWebGL:false,pdfBugEnabled:false,disableRange:false,disableStream:false,disableAutoFetch:false,disableFontFace:false,disableTextLayer:false,useOnlyCssZoom:false,externalLinkTarget:0,enhanceTextSelection:false,renderer:"canvas",renderInteractiveForms:false,enablePrintAutoRotate:true,disablePageMode:false,disablePageLabels:false})}return o}var l=function(){function e(){var t=this;s(this,e);if(this.constructor===e){throw new Error("Cannot initialize BasePreferences.")}this.prefs=null;this._initializedPromise=u().then(function(e){Object.defineProperty(t,"defaults",{value:Object.freeze(e),writable:false,enumerable:true,configurable:false});t.prefs=(0,a.cloneObj)(e);return t._readFromStorage(e)}).then(function(e){if(e){t.prefs=e}})}r(e,[{key:"_writeToStorage",value:function e(t){return Promise.reject(new Error("Not implemented: _writeToStorage"))}},{key:"_readFromStorage",value:function e(t){return Promise.reject(new Error("Not implemented: _readFromStorage"))}},{key:"reset",value:function e(){var t=this;return this._initializedPromise.then(function(){t.prefs=(0,a.cloneObj)(t.defaults);return t._writeToStorage(t.defaults)})}},{key:"reload",value:function e(){var t=this;return this._initializedPromise.then(function(){return t._readFromStorage(t.defaults)}).then(function(e){if(e){t.prefs=e}})}},{key:"set",value:function e(t,n){var r=this;return this._initializedPromise.then(function(){if(r.defaults[t]===undefined){throw new Error('Set preference: "'+t+'" is undefined.')}else if(n===undefined){throw new Error("Set preference: no value is specified.")}var e=typeof n==="undefined"?"undefined":i(n);var a=i(r.defaults[t]);if(e!==a){if(e==="number"&&a==="string"){n=n.toString()}else{throw new Error('Set preference: "'+n+'" is a '+e+", "+("expected a "+a+"."))}}else{if(e==="number"&&(n|0)!==n){throw new Error('Set preference: "'+n+'" must be an integer.')}}r.prefs[t]=n;return r._writeToStorage(r.prefs)})}},{key:"get",value:function e(t){var n=this;return this._initializedPromise.then(function(){var e=n.defaults[t];if(e===undefined){throw new Error('Get preference: "'+t+'" is undefined.')}else{var i=n.prefs[t];if(i!==undefined){return i}}return e})}}]);return e}();t.BasePreferences=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DownloadManager=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();var r=n(1);function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function s(e,t){var n=document.createElement("a");if(n.click){n.href=e;n.target="_parent";if("download"in n){n.download=t}(document.body||document.documentElement).appendChild(n);n.click();n.parentNode.removeChild(n)}else{if(window.top===window&&e.split("#")[0]===window.location.href.split("#")[0]){var i=e.indexOf("?")===-1?"?":"&";e=e.replace(/#|$/,i+"$&")}window.open(e,"_parent")}}var o=function(){function e(){a(this,e)}i(e,[{key:"downloadUrl",value:function e(t,n){if(!(0,r.createValidAbsoluteUrl)(t,"http://example.com")){return}s(t+"#pdfjs.action=download",n)}},{key:"downloadData",value:function e(t,n,i){if(navigator.msSaveBlob){return navigator.msSaveBlob(new Blob([t],{type:i}),n)}var a=(0,r.createObjectURL)(t,i,r.PDFJS.disableCreateObjectURL);s(a,n)}},{key:"download",value:function e(t,n,i){if(navigator.msSaveBlob){if(!navigator.msSaveBlob(t,i)){this.downloadUrl(n,i)}return}if(r.PDFJS.disableCreateObjectURL){this.downloadUrl(n,i);return}var a=URL.createObjectURL(t);s(a,i)}}]);return e}();t.DownloadManager=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GenericL10n=undefined;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(t,n,i){if(n)e(t.prototype,n);if(i)e(t,i);return t}}();n(32);function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var a=document.webL10n;var s=function(){function e(t){r(this,e);this._lang=t;this._ready=new Promise(function(e,n){a.setLanguage(t,function(){e(a)})})}i(e,[{key:"getDirection",value:function e(){return this._ready.then(function(e){return e.getDirection()})}},{key:"get",value:function e(t,n,i){return this._ready.then(function(e){return e.get(t,n,i)})}},{key:"translate",value:function e(t){return this._ready.then(function(e){return e.translate(t)})}}]);return e}();t.GenericL10n=s},function(e,t,n){"use strict";document.webL10n=function(e,t,n){var i={};var r="";var a="textContent";var s="";var o={};var u="loading";var l=true;function c(){return t.querySelectorAll('link[type="application/l10n"]')}function d(){var e=t.querySelector('script[type="application/l10n"]');return e?JSON.parse(e.innerHTML):null}function h(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}function f(e){if(!e)return{};var t=e.getAttribute("data-l10n-id");var n=e.getAttribute("data-l10n-args");var i={};if(n){try{i=JSON.parse(n)}catch(e){console.warn("could not parse arguments for #"+t)}}return{id:t,args:i}}function v(e){var n=t.createEvent("Event");n.initEvent("localized",true,false);n.language=e;t.dispatchEvent(n)}function g(n,i,r){i=i||function e(t){};r=r||function e(){};var a=new XMLHttpRequest;a.open("GET",n,l);var s=t.charset;if(!!e.pdfJsLangCharset){s=e.pdfJsLangCharset}if(a.overrideMimeType){a.overrideMimeType("text/plain; charset="+s)}a.onreadystatechange=function(){if(a.readyState==4){if(a.status==200||a.status===0){i(a.responseText)}else{r()}}};a.onerror=r;a.ontimeout=r;try{a.send(null)}catch(e){r()}}function p(e,t,n,s){var o=e.replace(/[^\/]*$/,"")||"./";function u(e){if(e.lastIndexOf("\\")<0)return e;return e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function l(e,n){var i={};var r=/^\s*|\s*$/;var a=/^\s*#|^\s*$/;var s=/^\s*\[(.*)\]\s*$/;var l=/^\s*@import\s+url\((.*)\)\s*$/i;var c=/^([^=\s]*)\s*=\s*(.+)$/;function d(e,n,d){var f=e.replace(r,"").split(/[\r\n]+/);var v="*";var g=t.split("-",1)[0];var p=false;var m="";function w(){while(true){if(!f.length){d();return}var e=f.shift();if(a.test(e))continue;if(n){m=s.exec(e);if(m){v=m[1].toLowerCase();p=v!=="*"&&v!==t&&v!==g;continue}else if(p){continue}m=l.exec(e);if(m){h(o+m[1],w);return}}var r=e.match(c);if(r&&r.length==3){i[r[1]]=u(r[2])}}}w()}function h(e,t){g(e,function(e){d(e,false,t)},function(){console.warn(e+" not found.");t()})}d(e,true,function(){n(i)})}g(e,function(e){r+=e;l(e,function(e){for(var t in e){var r,s,o=t.lastIndexOf(".");if(o>0){r=t.substring(0,o);s=t.substr(o+1)}else{r=t;s=a}if(!i[r]){i[r]={}}i[r][s]=e[t]}if(n){n()}})},s)}function m(e,t){if(e){e=e.toLowerCase()}t=t||function e(){};w();s=e;var n=c();var r=n.length;if(r===0){var a=d();if(a&&a.locales&&a.default_locale){console.log("using the embedded JSON directory, early way out");i=a.locales[e];if(!i){var o=a.default_locale.toLowerCase();for(var l in a.locales){l=l.toLowerCase();if(l===e){i=a.locales[e];break}else if(l===o){i=a.locales[o]}}}t()}else{console.log("no resource to load, early way out")}v(e);u="complete";return}var h=null;var f=0;h=function n(){f++;if(f>=r){t();v(e);u="complete"}};function g(e){var t=e.href;this.load=function(e,n){p(t,e,n,function(){console.warn(t+" not found.");console.warn('"'+e+'" resource not found');s="";n()})}}for(var m=0;m<r;m++){var b=new g(n[m]);b.load(e,h)}}function w(){i={};r="";s=""}function b(e){var t={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3};function n(e,t){return t.indexOf(e)!==-1}function i(e,t,n){return t<=e&&e<=n}var r={0:function e(t){return"other"},1:function e(t){if(i(t%100,3,10))return"few";if(t===0)return"zero";if(i(t%100,11,99))return"many";if(t==2)return"two";if(t==1)return"one";return"other"},2:function e(t){if(t!==0&&t%10===0)return"many";if(t==2)return"two";if(t==1)return"one";return"other"},3:function e(t){if(t==1)return"one";return"other"},4:function e(t){if(i(t,0,1))return"one";return"other"},5:function e(t){if(i(t,0,2)&&t!=2)return"one";return"other"},6:function e(t){if(t===0)return"zero";if(t%10==1&&t%100!=11)return"one";return"other"},7:function e(t){if(t==2)return"two";if(t==1)return"one";return"other"},8:function e(t){if(i(t,3,6))return"few";if(i(t,7,10))return"many";if(t==2)return"two";if(t==1)return"one";return"other"},9:function e(t){if(t===0||t!=1&&i(t%100,1,19))return"few";if(t==1)return"one";return"other"},10:function e(t){if(i(t%10,2,9)&&!i(t%100,11,19))return"few";if(t%10==1&&!i(t%100,11,19))return"one";return"other"},11:function e(t){if(i(t%10,2,4)&&!i(t%100,12,14))return"few";if(t%10===0||i(t%10,5,9)||i(t%100,11,14))return"many";if(t%10==1&&t%100!=11)return"one";return"other"},12:function e(t){if(i(t,2,4))return"few";if(t==1)return"one";return"other"},13:function e(t){if(i(t%10,2,4)&&!i(t%100,12,14))return"few";if(t!=1&&i(t%10,0,1)||i(t%10,5,9)||i(t%100,12,14))return"many";if(t==1)return"one";return"other"},14:function e(t){if(i(t%100,3,4))return"few";if(t%100==2)return"two";if(t%100==1)return"one";return"other"},15:function e(t){if(t===0||i(t%100,2,10))return"few";if(i(t%100,11,19))return"many";if(t==1)return"one";return"other"},16:function e(t){if(t%10==1&&t!=11)return"one";return"other"},17:function e(t){if(t==3)return"few";if(t===0)return"zero";if(t==6)return"many";if(t==2)return"two";if(t==1)return"one";return"other"},18:function e(t){if(t===0)return"zero";if(i(t,0,2)&&t!==0&&t!=2)return"one";return"other"},19:function e(t){if(i(t,2,10))return"few";if(i(t,0,1))return"one";return"other"},20:function e(t){if((i(t%10,3,4)||t%10==9)&&!(i(t%100,10,19)||i(t%100,70,79)||i(t%100,90,99)))return"few";if(t%1e6===0&&t!==0)return"many";if(t%10==2&&!n(t%100,[12,72,92]))return"two";if(t%10==1&&!n(t%100,[11,71,91]))return"one";return"other"},21:function e(t){if(t===0)return"zero";if(t==1)return"one";return"other"},22:function e(t){if(i(t,0,1)||i(t,11,99))return"one";return"other"},23:function e(t){if(i(t%10,1,2)||t%20===0)return"one";return"other"},24:function e(t){if(i(t,3,10)||i(t,13,19))return"few";if(n(t,[2,12]))return"two";if(n(t,[1,11]))return"one";return"other"}};var a=t[e.replace(/-.*$/,"")];if(!(a in r)){console.warn("plural form unknown for ["+e+"]");return function(){return"other"}}return r[a]}o.plural=function(e,t,n,r){var u=parseFloat(t);if(isNaN(u))return e;if(r!=a)return e;if(!o._pluralRules){o._pluralRules=b(s)}var l="["+o._pluralRules(u)+"]";if(u===0&&n+"[zero]"in i){e=i[n+"[zero]"][r]}else if(u==1&&n+"[one]"in i){e=i[n+"[one]"][r]}else if(u==2&&n+"[two]"in i){e=i[n+"[two]"][r]}else if(n+l in i){e=i[n+l][r]}else if(n+"[other]"in i){e=i[n+"[other]"][r]}return e};function y(e,t,n){var r=i[e];if(!r){console.warn("#"+e+" is undefined.");if(!n){return null}r=n}var a={};for(var s in r){var o=r[s];o=P(o,t,e,s);o=S(o,t,e);a[s]=o}return a}function P(e,t,n,r){var a=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;var s=a.exec(e);if(!s||!s.length)return e;var u=s[1];var l=s[2];var c;if(t&&l in t){c=t[l]}else if(l in i){c=i[l]}if(u in o){var d=o[u];e=d(e,c,n,r)}return e}function S(e,t,n){var r=/\{\{\s*(.+?)\s*\}\}/g;return e.replace(r,function(e,r){if(t&&r in t){return t[r]}if(r in i){return i[r]}console.log("argument {{"+r+"}} for #"+n+" is undefined.");return e})}function _(e){var n=f(e);if(!n.id)return;var i=y(n.id,n.args);if(!i){console.warn("#"+n.id+" is undefined.");return}if(i[a]){if(C(e)===0){e[a]=i[a]}else{var r=e.childNodes;var s=false;for(var o=0,u=r.length;o<u;o++){if(r[o].nodeType===3&&/\S/.test(r[o].nodeValue)){if(s){r[o].nodeValue=""}else{r[o].nodeValue=i[a];s=true}}}if(!s){var l=t.createTextNode(i[a]);e.insertBefore(l,e.firstChild)}}delete i[a]}for(var c in i){e[c]=i[c]}}function C(e){if(e.children){return e.children.length}if(typeof e.childElementCount!=="undefined"){return e.childElementCount}var t=0;for(var n=0;n<e.childNodes.length;n++){t+=e.nodeType===1?1:0}return t}function k(e){e=e||t.documentElement;var n=h(e);var i=n.length;for(var r=0;r<i;r++){_(n[r])}_(e)}return{get:function e(t,n,i){var r=t.lastIndexOf(".");var s=a;if(r>0){s=t.substr(r+1);t=t.substring(0,r)}var o;if(i){o={};o[s]=i}var u=y(t,n,o);if(u&&s in u){return u[s]}return"{{"+t+"}}"},getData:function e(){return i},getText:function e(){return r},getLanguage:function e(){return s},setLanguage:function e(t,n){m(t,function(){if(n)n()})},getDirection:function e(){var t=["ar","he","fa","ps","ur"];var n=s.split("-",1)[0];return t.indexOf(n)>=0?"rtl":"ltr"},translate:k,getReadyState:function e(){return u},ready:function n(i){if(!i){return}else if(u=="complete"||u=="interactive"){e.setTimeout(function(){i()})}else if(t.addEventListener){t.addEventListener("localized",function e(){t.removeEventListener("localized",e);i()})}}}}(window,document)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PDFPrintService=undefined;var i=n(0);var r=n(4);var a=n(1);var s=null;var o=null;function u(e,t,n,r){var a=s.scratchCanvas;var o=150;var u=o/72;a.width=Math.floor(r.width*u);a.height=Math.floor(r.height*u);var l=Math.floor(r.width*i.CSS_UNITS)+"px";var c=Math.floor(r.height*i.CSS_UNITS)+"px";var d=a.getContext("2d");d.save();d.fillStyle="rgb(255, 255, 255)";d.fillRect(0,0,a.width,a.height);d.restore();return t.getPage(n).then(function(e){var t={canvasContext:d,transform:[u,0,0,u,0,0],viewport:e.getViewport(1,r.rotation),intent:"print"};return e.render(t).promise}).then(function(){return{width:l,height:c}})}function l(e,t,n,r){this.pdfDocument=e;this.pagesOverview=t;this.printContainer=n;this.l10n=r||i.NullL10n;this.currentPage=-1;this.scratchCanvas=document.createElement("canvas")}l.prototype={layout:function e(){this.throwIfInactive();var t=document.querySelector("body");t.setAttribute("data-pdfjsprinting",true);var n=this.pagesOverview.every(function(e){return e.width===this.pagesOverview[0].width&&e.height===this.pagesOverview[0].height},this);if(!n){console.warn("Not all pages have the same size. The printed "+"result may be incorrect!")}this.pageStyleSheet=document.createElement("style");var i=this.pagesOverview[0];this.pageStyleSheet.textContent="@supports ((size:A4) and (size:1pt 1pt)) {"+"@page { size: "+i.width+"pt "+i.height+"pt;}"+"}";t.appendChild(this.pageStyleSheet)},destroy:function e(){if(s!==this){return}this.printContainer.textContent="";if(this.pageStyleSheet&&this.pageStyleSheet.parentNode){this.pageStyleSheet.parentNode.removeChild(this.pageStyleSheet);this.pageStyleSheet=null}this.scratchCanvas.width=this.scratchCanvas.height=0;this.scratchCanvas=null;s=null;m().then(function(){if(o.active!=="printServiceOverlay"){return}o.close("printServiceOverlay")})},renderPages:function e(){var t=this;var n=this.pagesOverview.length;var i=function e(i,r){t.throwIfInactive();if(++t.currentPage>=n){f(n,n,t.l10n);i();return}var a=t.currentPage;f(a,n,t.l10n);u(t,t.pdfDocument,a+1,t.pagesOverview[a]).then(t.useRenderedPage.bind(t)).then(function(){e(i,r)},r)};return new Promise(i)},useRenderedPage:function e(t){this.throwIfInactive();var n=document.createElement("img");n.style.width=t.width;n.style.height=t.height;var i=this.scratchCanvas;if("toBlob"in i&&!a.PDFJS.disableCreateObjectURL){i.toBlob(function(e){n.src=URL.createObjectURL(e)})}else{n.src=i.toDataURL()}var r=document.createElement("div");r.appendChild(n);this.printContainer.appendChild(r);return new Promise(function(e,t){n.onload=e;n.onerror=t})},performPrint:function e(){try{o.close("printServiceOverlay")}finally{}var t=this;this.throwIfInactive();return new Promise(function(e){setTimeout(function(){if(!t.active){e();return}c.call(window)},0)})},get active(){return this===s},throwIfInactive:function e(){if(!this.active){throw new Error("This print request was cancelled or completed.")}}};var c=window.print;window.print=function e(){if(s){console.warn("Ignored window.print() because of a pending print job.");return}m().then(function(){if(s){o.open("printServiceOverlay")}});try{d("beforeprint")}finally{if(!s){console.error("Expected print service to be initialized.");m().then(function(){if(o.active==="printServiceOverlay"){o.close("printServiceOverlay")}});return}var t=s;s.renderPages().then(function(){return t.performPrint()}).catch(function(){}).then(function(){if(t.active){h()}})}};function d(e){var t=document.createEvent("CustomEvent");t.initCustomEvent(e,false,false,"custom");window.dispatchEvent(t)}function h(){if(s){s.destroy();d("afterprint")}}function f(e,t,n){var i=document.getElementById("printServiceOverlay"+window.pdfJsViewerId);var r=Math.round(100*e/t);var a=i.querySelector("progress");var s=i.querySelector(".relative-progress");a.value=r;n.get("print_progress_percent",{progress:r},r+"%").then(function(e){s.textContent=e})}var v=!!document.attachEvent;window.addEventListener("keydown",function(e){if(e.keyCode===80&&(e.ctrlKey||e.metaKey)&&!e.altKey&&(!e.shiftKey||window.chrome||window.opera)){window.print();if(v){return}e.preventDefault();if(e.stopImmediatePropagation){e.stopImmediatePropagation()}else{e.stopPropagation()}return}},true);if(v){document.attachEvent("onkeydown",function(e){e=e||window.event;if(e.keyCode===80&&e.ctrlKey){e.keyCode=0;return false}})}if("onbeforeprint"in window){var g=function e(t){if(t.detail!=="custom"&&t.stopImmediatePropagation){t.stopImmediatePropagation()}};window.addEventListener("beforeprint",g);window.addEventListener("afterprint",g)}var p;function m(){if(!p){o=r.PDFViewerApplication.overlayManager;if(!o){throw new Error("The overlay manager has not yet been initialized.")}p=o.register("printServiceOverlay",document.getElementById("printServiceOverlay"+window.pdfJsViewerId),h,true);document.getElementById("printCancel"+window.pdfJsViewerId).onclick=h}return p}r.PDFPrintServiceFactory.instance={supportsPrinting:true,createPrintService:function e(t,n,i,r){if(s){throw new Error("The print service is created and active.")}s=new l(t,n,i,r);return s}};t.PDFPrintService=l}]);
//# sourceMappingURL=pdf_viewer.map.js